3 ms·
Ok, so what you did instead was to effectively put "throws Exception" on every method by default. That implicit throws clause was already there in any language
by pohl 14y ago
Ok, so what you did instead was to effectively put "throws Exception" on every method by default.
That implicit throws clause was already there in any language that contains unchecked exceptions for things like dereferencing a null pointer, or assertions, etc. So, no, that's not what removing checked exceptions does. Personally, I'm a big fan of Guava's Throwables class. The java I write these days transmutes all checked exceptions into unchecked wrappers at any API boundary that tries to force them on me. And, no, this doesn't mean I'm only coding for the happy case. Rather, I'm choosing where and how to handle the sadness.
- lsd5you 14y agoIt depends what standards you hold the library to. Null pointer exceptions and other runtime exceptions are can be treated as errors - something which needs fixing in the code, rather than something that can be handled. A world of difference.
- pohl 14y agoAnd that is still the case with the Guava Throwables strategy, which only effects how checked exceptions are propagated.