3 ms·
Exceptions are extremely controversial in programming language circles. They reduce encapsulation, and the try/catch syntax as seen in java encourages bad error
by seabrookmx 13y ago
Exceptions are extremely controversial in programming language circles. They reduce encapsulation, and the try/catch syntax as seen in java encourages bad error handling. Any idiot can put their whole program in a giant try/catch block.
It's really a hard design problem. I agree that some form of error handling should be a language default, but I'm not sure if "traditional" exceptions should be it. As a C++ dev who has worked on projects with and without exceptions, I can say there is pros and cons to both.
- lucian1900 13y agoIt's not that hard, basically a solved problem in Common Lisp and more recently Rust: use conditions. They only unwind (not re-wind), so there's no worry about exception safety (as in C++) and they allow strictly more power than exceptions.