A new perspective (for me) on exception handling

I was going through my normal routine of reading other people's blog posts, and I came across a very interesting post by Julia Lerman's blog about exception handling. The post can be found here.

Now I've read this perspective before, but when I thought about code that I've written recently, I reckon I haven't applied the perspectives that she advocates.

Published Friday, May 13, 2005 8:59 AM by trumpi
Filed under:

Comments

# re: A new perspective (for me) on exception handling

Be careful going down that road, it's easy to get into the "throw exceptions when anything is not the way I expect it" mindset and create a very unusable library. A case in point:

http://dotnet.org.za/colin/archive/2004/12/22/11196.aspx

Friday, May 13, 2005 10:53 AM by Colin

# re: A new perspective (for me) on exception handling

I get your point, but the new perspective that I was talking about was that sometimes testing for exception conditions is less efficient than risking the possibility of an exception being thrown.

Friday, May 13, 2005 10:58 AM by Trevor Green

# re: A new perspective (for me) on exception handling

I think there is a sweet spot so getting that perspective from Jeff, while extreme perhaps, is important for me, at least, to have in my mind while I am planning my exceptions.

Friday, May 13, 2005 4:42 PM by Julie