3 ms·
I agree with the classification of TA, but I disagree on the "vexing exceptions". Even if you get a `Result` that you can pattern match over, the error handling
by samus 1y ago
I agree with the classification of TA, but I disagree on the "vexing exceptions". Even if you get a `Result` that you can pattern match over, the error handling code looks exactly as ugly if you put it into a pattern match branch as inside of a `catch` block.
- tyleo 1y agoI slightly disagree. I think two things are better with the result type: 1. Exception overhead. Exceptions capture diagnostics and unwind stacks in ways that add cost to the user-error case. 2. Type system information. With the result type, you declare the possibility to fail, and exactly what failures to expect in normal operation. You can switch over specific errors vs the broad category of anything that inherits from `Exception`