15 ms·
I think the problem is that checked exceptions seem to defeat the benefits of using exceptions. You're better off returning something like Rust's Result type.
by wtetzner 8y ago
I think the problem is that checked exceptions seem to defeat the benefits of using exceptions.
You're better off returning something like Rust's Result type.
- gpderetta 8y agoThey are completely equivalent.
- wtetzner 8y agoThey aren't, because you have to use clunky verbose syntax (and try/catch blocks aren't expressions, which makes things worse). Also, there are several limitations on generics with exceptions that don't exist with regular values. My point is that there's no reason to include special syntax/concepts for checked exceptions over just using values.
- EdwardDiego 8y agoI quite prefer the Option monad approach in Scala where you can pattern match the result. Far more succinct and doesn't require program logic flow to be interrupted.
- deleted 8y ago[deleted]