| ▲ | jandrewrogers a day ago | |||||||
There isn't much of a conversation to be had here. For low-level systems code, exceptions introduce a bunch of issues and ugly edge cases. Error codes are cleaner, faster, and easier to reason about in this context. Pretty much all systems languages use error codes. In C++, which supports both, exceptions are commonly disabled at compile-time for systems code. This is pretty idiomatic, I've never worked on a C++ code base that used exceptions. On the other hand, high-level non-systems C++ code may use exceptions. | ||||||||
| ▲ | bluGill 15 hours ago | parent | next [-] | |||||||
What you wrote is historically correct, but new analisys shows exceptions are faster that error codes if you actually check the error codes. Of course checking error codes is tedious and so often you don't. Also is micro benchmarks error codes are faster and only when you do more complex benchmarks do exceptions show up as faster. | ||||||||
| ||||||||
| ▲ | dzonga a day ago | parent | prev [-] | |||||||
thanks for the explanation. | ||||||||