Poor Exception Handling is Expensive
Doing my daily walk through the blogosphere, every once in a while I come across a gem that I can’t help but share. David Van Couvering‘s blog entry entitled The Curse of the Swallowed Exception is one of these gems The second paragraph alone was enough to earn him a spot in my reader:
I think one of the most common and most expensive (in terms of maintenance) programming errors I see is the handling of exceptions.
I couldn’t agree more.
Many times, a significant portion of maintenance cost goes into the developer digging through the logs, trying to figure out what happened. If exceptions are swallowed (resulting in no error logging), then the developer has no idea where to begin and must start walking the code to see if they can identify the problem. Even worse is when the errors are obfuscated, resulting in the stack trace pointing to the wrong location. This sends the developer on a wild goose chase, and in the end they are no better off than they would have been had no error log been produced at all. This is not only very time consuming, but also very frustrating for the engineer. Anyone who has ever attempted to set up an instance of the Oracle Application Server from scratch has likely beat their heads against their desk many a night while trying to figure out the culprit behind one of their ultra-generic error messages.
Long story short, poor exception handling can drive the price of maintenance up and the quality of life for the maintaining engineer down. Take a look at David’s blog, in which he details 7 Principles of Exception Handling and Reporting. Implementing them can definately make life easier on both the customer and maintaining engineer further down the road.

Comments
Be the first to comment!
Leave A Comment