Wednesday, September 26, 2012

On exceptions

I've been reading some blog posts on exceptions recently. The one I hadn't seen before, and the one that makes a lot of sense to me is:

Cleaner, more elegant, and harder to recognize

The argument put forward is that yes, using exceptions does make for cleaner code, but

  1. It's easier to write bad code that uses exceptions
  2. It's harder to recognize good code from bad code when using exceptions
The D language has an interesting scope guard statement. Not having played with this, I don't know what the ramifications are in practice. I haven't used this in C++. I wonder how ugly the code gets?

0 comments:

Post a Comment