I saw this over at Peter Foot's blog and the first thing I thought was "Maybe they are using Exception handling to control program flow?"; by this I mean just trying to use a Proxy without first checking to see if it's valid, and handling this situation in a try/catch block. I have the utmost repect for the CF team, so maybe this is not what they're doing, or maybe they have a good reason for doing so.
Regardless of what the CF team is doing, this re-opened a barely healed wound. I recently inherited a codebase which I am modifying to help a friend. This code is riddled with the age-old no no of "Using exception handling blocks to control program flow". I think I first saw this best practice in Bjarne Stroustroup's "The C++ Programming Language" at least ten years ago. The code has things like catching NullReferenceException rather than checking for null first, and catching ClassCastException rather than checking a column's DBNull status. Logic that should be the "if" or "else" of a condition statement is then executed in the catch{} block. Not only is this ugly practice making the code hard to read, but considering the frequency of these conditions the code is being slowed down quite a bit while the exception is handled.
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.0.7226.0
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Damon Payne
E-mail