Re:The Year of C++ Successor Languages
by worik on Tuesday January 03, 2023 @02:59PM
(#34237133)
The point is there is no advantage to throwing an exception VS. using sum type return values (e.g. Result types in Rust)
[ Parent
| on HN ]
Re:The Year of C++ Successor Languages
by kllrnohj on Wednesday January 04, 2023 @08:09AM
(#34245093)
That'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.