3 ms·
The difference between error codes and exceptions are that, for error codes, you must check the result of every function call and method and in some way handle
by wvenable 17y ago
The difference between error codes and exceptions are that, for error codes, you must check the result of every function call and method and in some way handle that result. Contrast this to exceptions, where the advantage is that your error handling is centralized. You should throw as much as necessary and catch in a few key places.
Checked exceptions ruins that advantage of exceptions -- you're back to writing a whole bunch of buggy error handling code rather than just a few key catches. The result is errors are being hidden, masked, or ignored for absolutely no gain except to satisfy the compiler.