4 ms·
Sounds like checked and unchecked exceptions. I mean, this could be a syntax wrapper for java checked exceptions right? Those are isomorphic to Result<_, Err>
by Tyr42 8mo ago
Sounds like checked and unchecked exceptions.
I mean, this could be a syntax wrapper for java checked exceptions right?
Those are isomorphic to Result<_, Err> in that you must handle or propagate the error. The syntax is different, sure.
- HendrikHensen 8mo agoCorrect. Although the performance characteristics are different. An exception in Java generates a stack trace, which is relatively expensive. So not a great idea in un-exceptional code paths that need to perform well.
- vips7L 8mo agoStack trace collection is optional. If you actually hit a performance problem on a checked exception path you just override the stack trace collection not to happen. I do this in most of my projects that use checked exceptions as domain errors. Only once you have to panic, i.e wrap in an unchecked exception, stack trace collection happens.