3 ms·
Won't be the first time that I think Stroustrup has made a serious error, and is compounding his error by not repudiating the feature. Go read Sutter's _Except
by kabdib 12y ago
Won't be the first time that I think Stroustrup has made a serious error, and is compounding his error by not repudiating the feature.
Go read Sutter's _Exceptional C++_ or any of its follow-on books. It appears nearly impossible to write solid software when you allow exceptions into your set of control structures.
The best response to an exception is: Restart. Catch the exception in something like main(), take a dump or write some diagnostics, and restart your app. You'll have a system that is more reliable and of better quality than if you try to handle exceptions "correctly" in the face of non-exception-neutral code, 3rd party libraries that get things wrong, and your own bugs, which are going to be many, and deep, and subtle, and probably intractable.
- AnimalMuppet 12y agoC++ is used in many environments where "restart" is not a viable option.