3 ms·
Doing a try/catch doesn't imply anything, except that an exception occurred that you caught. Behavior after that is completely app dependent. Top-level try/ca
by kenjackson 16y ago
Doing a try/catch doesn't imply anything, except that an exception occurred that you caught. Behavior after that is completely app dependent.
Top-level try/catch blocks that simply do logging and nothing below that may not always be a bad idea, but its usually a sign of a poorly designed app.
And why can't you get extra-permissions or recover from not having enough memory? I've certainly worked on systems with the later, where we catch an OutOfMemoryException and then do some stuff we're required to do -- including in some situations to get memory back (which is for example, why we'll often pre-JIT and keep loaded code required to free up memory).
Checked exceptions are a big fail, but largely because they're a broken way of thinking about exceptions (and why Java was the last major language to have them).
EDIT: I glossed over the fact that you may have been actually getting at which is the requirement associated with checked exceptions. You're absolutely correct there. No argument from me. I wasn't think of that originally, as I'm not a Java dev.
- rbanffy 16y ago> Doing a try/catch Doing try/catch tells the compiler you know what you are doing. I prefer compilers that take that as a given.