Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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++.



Because resumption wasn't actually necessary for such a context inquiry, they removed it and found a significant speed increase in that part of the system.

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.


That's pretty shocking, given Stroustrup's propensity to just dump everything into C++. It's also a bit of a shame it didn't get a chance to see the wider audience C++ would've brought.


People have that impression - that Stroustrup "dumped everything into C++" - but it's demonstrably not true if you read D&E. Every new feature that made it into the language after the standardization point had a working implementation, and people had experience with that implementation. He goes over lots of rejected features.

Also consider what your statement implies: Stroustrup put too many features into C++ (bad), but he did not put feature X into C++ (also bad). You're faulting him for accepting too much, but at the same time, for not accepting one in particular. Although it should really be noted that post-standardization, what made it into C++ was a committee decision, not Stroustrup alone.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: