Charlie Reitzel wrote: > Point being, there is a gradation of programming techniques appropriate to > different environments. > > However, I have yet to find an actual working environment that would call > for using Exceptions as normal flow control (same goes for setjmp/longjmp). > > In my experience, if you find yourself reaching for "heroic" of coding > techniques, you need to rethink and regroup and come at the problem a > different way. That's how you get the 10x factors of speed > improvement. Let hardware upgrades give you the 10-20% improvements.
I am not sure if you're saying that "heroic" coding techniques should always be seen as a sign that you're doing something wrong. I could not agree with that, though I could agree (who would not) with the notion that most of the time most code benefits more from re-thinking the problem than from concentrating on "heroic" optimization. However, I am reminded of Charles Petzold's excellent article in 'Beautiful Code' in which he explains the rationale behind the implementation of BitBlt, which could surely be considered in the realm of "heroic" techniques, as it uses dynamic machine code generation to avoid test/branch cases. He then proceeds to describe a modern variation that dynamically generates .NET IL code (which then dynamically turns into machine code) to handle image processing tasks. (Much of the article is visible in Google books.) No one would say that all code would be better if it worked this way. But there are times & places for such techniques, just as there are times & places for Perl, Python, C, D, Forth, APL, F#, JavaScript, Lua, etc, etc, etc... _______________________________________________ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm