News for hackers. Stuff that matters.
Re:12 (Really) Controversial Programming Opinions by hackinthebochs on Sunday September 02, 2012 @01:14AM (#4466237)
If you need an exception here, you're just a bad programmer. It's your fault you didn't explicitly check that the lock was functional before poking that lion! /s
Re:12 (Really) Controversial Programming Opinions by Quarrelsome on Sunday September 02, 2012 @01:19AM (#4466248)
Sure but are you telling me you always work on teams where everyone is shit hot?

If you write a library are you thinking that everyone is going to use it properly?

My point is that exceptions help people to learn how to use APIs (its kinda like documentation that appears through use!) and exceptions make things _safer_.

I appreciate you could write the above in two try catches but my point is that it would look more wrong. The code above _looks_ fine and that's my point.

Re:12 (Really) Controversial Programming Opinions by hackinthebochs on Sunday September 02, 2012 @01:32AM (#4466276)
Hah, I guess my post could have used a sarcasm tag :)

I totally agree that exceptions are far superior than checking return values.

Re:12 (Really) Controversial Programming Opinions by xionon on Sunday September 02, 2012 @01:18AM (#4466247)
But sometimes it's not just the programmer that gets bitten, it's all the other people at the zoo, too. Exceptions help protect everyone.