2 ms·
The point is there is no advantage to throwing an exception VS. using sum type return values (e.g. Result types in Rust)
by worik 4y ago
The point is there is no advantage to throwing an exception VS. using sum type return values (e.g. Result types in Rust)
- kllrnohj 4y agoThat's a bad point? Exceptions are not normal control flow. They are rare or, as one might say, exceptional. The performance of them when thrown isn't of key concern, it's the performance when they are not thrown that matters since that's the >90% case. And in that case, code using exceptions is faster than code using sum type return values, especially if those errors propagate deeply across the call stack which they very often do.