This seem to be the absolutely hardest topic for otherwise smart programmers to get. No matter what language or job I've had, most of my colleagues have failed miserably at handling exceptions correctly. What I'm talking about is code like this, following the Pokémon Exception Handling pattern (gotta catch 'em all!):
try {
...
} catch (Exception ex) {
// Log and pretend nothing happened.
Log.LogException(ex);
}
The best programmers understand why the above is wrong. They know what fail fast means and understands the Samurai Principle. 99.9% of all don't. They look at the above code and say "What!? That's exactly how you should write your code! Error handling is important!" Those people are the reason why programs fail for random reasons, why most code bases are messy and hard to work with. Below I've compiled a list of sources that explains why the above code snippet is bad. Most programmers never change their habits, but for some there is hope: