3 ms·
The problem is that even if the programmer is forced to deal with every error condition, they might think a particular error is not likely and write a dummy han
by amelius 7y ago
The problem is that even if the programmer is forced to deal with every error condition, they might think a particular error is not likely and write a dummy handler (like print something and hope for the best). In that case exceptions are superior because at least they wind down the stack and allow a caller to deal with the situation, and prevent a crash.
- erik_seaberg 7y agoWhen people don't care, you have to make doing it right easier than doing it wrong.
- clinta 7y agoOr at least force it to be an intentional decision to do it wrong, which go does. Exceptions permit the programmer to be unaware that the function they're calling could throw an exception.