3 ms·
> try...catch is far, far superior. Why ? Because it terminates your application Nope, that's try without a catch. Every time you catch an exception you preven
by notacoward 8y ago
> try...catch is far, far superior. Why ? Because it terminates your application
Nope, that's try without a catch. Every time you catch an exception you prevent that (though of course you can turn around and terminate anyway).
> try...catch gives you exactly what happened
Depends on the implementation. Python's is actually one of the best this way. For C++ what you say is simply not true. It's possible for an extremely diligent programmer to define exceptions that capture more useful state, but in practice almost no exception-intensive codebases provide as much information as in a typical error-return based system.
- kjeetgill 8y agoI find Java stack traces to be among the most readable. Exactly one line per stack frame, and just enough information to hunt the source file/library down the whole call stack. Python is good but slightly too verbose because it needs to dump whole file paths.