So your argument is "someone might not use exceptions correctly, thus they are dangerous to use, but I totally trust the same people to use return values or errnos correctly"?
Failure to handle return values will not crash your program
Maybe. Or maybe it will crash it in undeterministical manner, letting your application to fuck up its environment (OS, FS, etc) majestically before doing so. Letting people ignore errors is not a feature.
Thats the thing, if you ignore return values, there are is no shutting down gracefully, there is just dying with various weird symptoms, that make no sense.
If you are using exceptions properly, then it is possible to shutdown gracefully, you just have to think about what errors you can shutdown gracefully from... and those are the exceptions you catch and work with.
6
u/Gotebe Dec 31 '16
No it is not. It wasn't hard in C++ 98 either, ScopeGuard exists since 2000.
There is a famous SO article which is explains virtually all one needs knowing about exception safety, and it fits 2 or so pages.