2 ms·
Not all isomorphic representations are equally ergonomic. Exceptions require special additional syntax, Result is “just” another value.
by akavi 7y ago
Not all isomorphic representations are equally ergonomic. Exceptions require special additional syntax, Result is “just” another value.
- barrkel 7y agoEnsuring error values get all the way to the top-level error handling loop is generally more ergonomic with exceptions, not less. It's easier for values to fall by the wayside, and for errors not to propagate when they're paired (type-wise) with values. If you do a lot of error handling close to the point of the error condition being found, the Rust / checked exceptions approach works well. For the kinds of applications that are written in Java, it's not the case. Most error conditions need to be propagated and the action in flight aborted.
- 0815test 7y ago> Most error conditions need to be propagated and the action in flight aborted. That's exactly what the '?' operator does. It's just as ergonomic as Java exceptions, and it doesn't hide the places where errors can be returned and the execution flow can be diverted.