Writing Exception-Safe Code

C++, Error Handling No Comments »

Today I ran across the article catch considered harmful on Michael Grier’s weblog which discusses some of the perils of exceptions. This, combined with articles in the C++ Users Journal about the difficulties in writing exception-safe containers, has given me terrible pause. Considering Herb Sutter’s excellent reputation, I want to read the following article as it may help clean up the mess:

Sutter, Herb. “When and How to Use Exceptions.” C++ Users Journal, August 2004.

It seems that most of the problems of exceptions come from interactions with persistent state, which functional languages (the original source of exceptions) do not have.

Programming is much more difficult than most programmers think it is, especially considering how even seemingly simple bugs such as integer overflow can lead to viruses and losses of billions of dollars in productivity.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in