4 ms·
I think it removes bugs caused by the try/catch pattern which can make it very difficult to follow the path of execution. In a sense exceptions have the same is
by rifung 8y ago
I think it removes bugs caused by the try/catch pattern which can make it very difficult to follow the path of execution. In a sense exceptions have the same issues as "goto".
It's not that they are inherently bad so much as it requiring discipline to stop things from getting out of hand, and that's just something you want to avoid in larger projects. If you need to be disciplined you might as well just check the return error value.
- cakoose 8y agoExceptions seem less unstructured than "goto". With exceptions, at least everything is strictly nested. And there's a new class of bugs: forgetting to check for an error. In Rust, the compiler won't let you forget. With exceptions, forgetting to handle an exception will result in a somewhat controlled termination process. In Go, execution will just continue in a bad state.