|
|
|
|
|
by scott_s
5026 days ago
|
|
In "The Design & Evolution of C++" (http://www.stroustrup.com/dne.html), Stroustrup talks about termination versus resumption semantics for exceptions. Resumption was considered for C++, but rejected based on experience in the Cedar/Mesa system. There's a quote from that part of the book on Wikipedia: http://en.wikipedia.org/wiki/Exception_handling#Exception_ha... Note that I'm not arguing that termination semantics are better - I've never programmed with resumption semantics, so I can't say. But that's why it's not in C++. |
|
s/resumption/exceptions/ and you have a secret to performance in Java.
If this is the core reason for termination-only exceptions in C++, Stroustrup made a huge mistake: he presumed that the best exception handling for mature, stable code was the best exception handing for all code. But then he also threw in a lot of features that cripple the language from ever being able to create truly mature, stable code (see http://www.250bpm.com/blog:4). Now the most stable, mature libraries are written in C.
C++ exceptions are then unreachable code, and a properly optimized programmer will never use them.