4 ms·
Because where the code that handles it is not the problem (in fact, optimisting that for simplicity could cause other problems). The problem is what state is ev
by robertlagrant 4y ago
Because where the code that handles it is not the problem (in fact, optimisting that for simplicity could cause other problems). The problem is what state is everything left in when the exception is thrown? What if you're halfway through writing to a file/network socket/screen/shared resource when an exception happens?
- papito 4y agoThat should be cleanly handled in a language like Python and others, where the context managers clean up the resources when exiting a scope, normally or after an exception. It's like stack unwinding is a new concept or something.
- robertlagrant 4y agoYou're missing the point. The OS resources might clean up, but that doesn't mean the application's world (some of which may be a file on a server on another continent) has been left in a known good state.