3 ms·
My argument: 'Exceptions should be exceptional', because exceptions are really just errors, that happen to be exceptional (rare)! The reason exceptions tend to
by electrograv 8y ago
My argument: 'Exceptions should be exceptional', because exceptions are really just errors, that happen to be exceptional (rare)!
The reason exceptions tend to be overused is because the line between error and exception is blurry -- and it's blurry precisely because an 'exception' is really just a subset of errors. Unfortunately, most languages do not treat exceptions as a subset of an error, but as a completely disjoint/orthogonal thing, and that's the problem!
If we transitioned to languages that handle these concepts in a unified way (and ones that don't allow unchecked exceptions), this isn't a problem at all, and we can all happily write much more inherently reliable software.