Exception Handling & Memory Management Slide Deck

Brad Abrams has made available a slide deck he has been pitching to .NET programmers.  I agree with almost everything except the slide titled "catch (Exception e) is your friend".

Put me in the camp of "catch (Exception ex)" is more often than not – evil. What I don’t get is that these two statements on that same slide: "Don’t attempt to catch every exception a method could throw" and "Catch what you need to handle and let the rest pass" fly in the face of "catch (Exception ex)". With this catch expression you *will* catch every exception, even those that you *don’t* want to handle.  Surely you’re not recommended casing on the type of the exception in the "catch (Exception ex)" statement?

Advertisements
This entry was posted in .NET. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s