News for hackers. Stuff that matters.
Re:Measuring execution performance of C++ exceptions vs. err... by marcosdumay on Monday January 09, 2017 @11:47AM (#13357634)
Even Java had to create some escape valve for its explicit exceptions, just because there was a huge set of them that could appear literally anywhere.

But then, exchanging that for return values does not make your life easier in any way. It just means you will have to write redundant tests, and will have a flow that is exactly equivalent to the exceptions flow, after you simplify the redundancy down.

You can have your compiler or IDE making the list of possible exceptions for you. But that list is always too big to reason about anyway, and for high order functions, it may be the entire set of exceptions available for your code and some more the it can't discover at compile time.

Haskell has tried a different take on the problem with error monads. It's clean, simple, and does not solve the entire problem. So, it also has exceptions, and they are even worse there than at the imperative languages, because everything is high order.

I think people are entirely justified in ignoring the problem and moving on. Unless you want to dedicate yourself into research, there is not a clear path to solve it.

There are no comments on this comment yet.