I know the *system* is not the same, but at least your compiled code is. The overhead of the empty call and return is pretty low, at least in a non-cached system. :)
As a further refinement, one could reduce the “overhead" down to a single function call in the IF itself: IF Out.Debug() THEN … debug code … END instead of IF debug THEN … debug code … END Of course, the debug code is still sitting there, as are the strings used by it, but it is never executed if Out.Debug() returns FALSE; which one can achieve by replacing the (dynamically-loaded) Out module with a stub version in production.. The purist will of course not be satisfied with all these shenanigans discussed here. Apart from compiler directives (which one can have different opinions about - see Tony Hoare’s comment), I don’t know of any truly satisfactory and/or “clean” solution to this.
The purist will of course not be satisfied with all these shenanigans discussed here.
Please remember that you are delivering your genial systems and solutions to non-genial users and programmers. Sometimes these are students, sometimes these are busy professors, sometimes in between. Please do not limit your audience to NW, PR, AP, and a few others who care about purity. Please provide tools which make SW development possible and maybe even enjoyable for the rest of us out there. Thanks, W
I second that motion. At the same time I like to remark that it often takes lots of discussion and thinking before a concept has become so clear that also a child can understand it. Which I take it is what we strive for. j. On Sun, Aug 12, 2018 at 4:35 PM, Skulski, Wojciech < skulski@pas.rochester.edu> wrote:
The purist will of course not be satisfied with all these shenanigans discussed here.
Please remember that you are delivering your genial systems and solutions to non-genial users and programmers. Sometimes these are students, sometimes these are busy professors, sometimes in between. Please do not limit your audience to NW, PR, AP, and a few others who care about purity. Please provide tools which make SW development possible and maybe even enjoyable for the rest of us out there.
Thanks, W -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
I just read through part of the discussion: What I seem to miss is the idea of "unit tests". IF Oberon had a "private Child Module" extension that has access to all internals of the parent then all internals of a Module can be tested in a concise way by a battery of tests with simple go /no-go outcome. This works great for regression tests also. I have never found any reason to have IF DEBUG statements in my code. The tests are normally finegrained enough to pick up a bug easily. The big advantage is that you simply uncouple your test framework from the code under test once done and do a final compilation. j. On Sun, Aug 12, 2018 at 8:22 PM, Jan de Kruyf <jan.de.kruyf@gmail.com> wrote:
I second that motion.
At the same time I like to remark that it often takes lots of discussion and thinking before a concept has become so clear that also a child can understand it.
Which I take it is what we strive for.
j.
On Sun, Aug 12, 2018 at 4:35 PM, Skulski, Wojciech < skulski@pas.rochester.edu> wrote:
The purist will of course not be satisfied with all these shenanigans discussed here.
Please remember that you are delivering your genial systems and solutions to non-genial users and programmers. Sometimes these are students, sometimes these are busy professors, sometimes in between. Please do not limit your audience to NW, PR, AP, and a few others who care about purity. Please provide tools which make SW development possible and maybe even enjoyable for the rest of us out there.
Thanks, W -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (3)
-
Andreas Pirklbauer -
Jan de Kruyf -
Skulski, Wojciech