Damien Katz: Error codes or Exceptions? Why is Reliable Software so Hard?:
Error codes or exceptions? Like static vs. dynamic programming languages or how great David Hasselhoff is (most people say great, I say super-great), it tends to turn into a pointless argument (”Hasselhoff is super-great ASSHOLE!”). Very little software really gets error handling right. Even many critical, backend server systems tend to break under heavy loads. And the vast majority of end-user applications handle errors gracefully only for the most well understood, commonly encountered conditions (e.g. HTTP timeout), but very poorly for most other conditions (failed allocations, bad data, I/O errors, missing files, etc). When these sorts of errors occur, bad things happen. Bad bad things. Like when my web browser crashes, taking one half-composed email and 8 open web pages with it. Why did a single flaw cause so much damage? I use Firefox and it’s pretty reliable compared to most applications. It’s engineered impressively, with logical program layers well separated and a great deal of the application logic is written in JavaScript, a high-level “safe” programming language. But occasionally it still just crashes or locks up.