4 ms·
There are some kinds of errors that can’t be handled locally, but do need to be handled globally, or generically higher in the call chain. Continuing execution
by jdlshore 5y ago
There are some kinds of errors that can’t be handled locally, but do need to be handled globally, or generically higher in the call chain. Continuing execution after the error occurs will make the problem worse. Exceptions allow you to cease execution without putting an if statement after every function call.
- jeffbee 5y agoThat's what you get from disabling exceptions: a call to std::abort instead of a throw.
- InfiniteRand 5y agoIn some ways that’s throwing an exception into the calling environment in the form of an error code
- WkndTriathlete 5y agoHaskell's IO monad says, "Hi! With me you don't need exceptions and you don't need to put an if statement after every function call."
- gpderetta 5y agoHow is the implicit control flow in do notation different from exceptions? If anything, the issue is between checked and unchecked exceptions.
- mibsl 5y agoHaskell's IO monad actually has excellent exception support, including async exceptions and masking them in critical sections. There are `Maybe` and `Either` and they're great at streamlining error handling in pure code, but when it comes to IO most libraries just throw exceptions (including the standard library).