4 ms·
> I like languages that push you to think about X or Y so you can't miss it. Yet most modern languages steer away from checked exceptions, that you cannot miss
by deepsun 5y ago
> I like languages that push you to think about X or Y so you can't miss it.
Yet most modern languages steer away from checked exceptions, that you cannot miss. And I agree with them, catching UrlMalformedException from a hardcoded static url is unnecessary.
But most importantly, checked exceptions just don't play well with FP, that's why they are getting pushed off the ship.
- AmpsterMan 5y agoI have such a weird relationship with checked exceptions in Java. I like checked exceptions because it makes exceptions part of the API. However, much of the time it's super intrusive and try-catch can be clunky. At this point I'm convinced there is no good solution from a language level for exceptions/errors. They just suck.
- valenterry 5y agoThe solution is already there. It's a combination of subtyping, union types, effect-handling and syntactic sugar for effect handling. checked exceptions would be fine id they were not so clunky.