Hacker News new | ask | show | jobs
by The_Colonel 1104 days ago
Unchecked exceptions are the better version of Result type.

The problem with checked exceptions is that methods throwing them force its callers to react to the even if they are irrelevant to them. In 99% of cases I don't have any JSON specific error handling, yet Jackson forces me to do a try-catch-rethrow ceremony in thpse 99% to declare I don't want to do anything specific.

1 comments

That’s the not too comfortable part. But with a tiny bit of syntax sugar (say, a ! or ? that expands to a mini-try-catch block) it would be more than fine.
Yes, I would be fine with a shorthand syntax like that. But it's not available which makes checked exceptions more trouble than worth.