Following on from my previous post about Java Lambdas and checked exceptions
I did a bit more research.
I found a revealing analysis of what
github programmers do when exception handling.
As far as I am concerned it goes
to demonstrate the failure of Java’s attitude to checked exceptions.
This is well worth a read; it would
seem that most developers do not respect checked exceptions at all, typically
ignoring them entirely or doing nothing more than logging and swallowing.
Take a look at figures 7 and 8 of the
report. Clearly a lot of catch blocks are entirely empty, however what about
the ones that do a bit of printing/logging? They looked closer and found that typically
when either logging/printing take place then these are typically the only
operations done in the catch; so only a tiny bit better than an empty catch
block.
It is hard to believe that in the
vast majority of cases it is really acceptable for a program to carry on
without taking any action – however that’s what we see across github.
Quality
software!
No comments:
Post a Comment