Checked exceptions

For a long time, I have been really annoyed with checked exceptions in Java. They break encapsulation and seem to pop up all over the place especially when I’m really busy and irritable. And because I have to handle these exceptions right there in the middle of my code where I don’t want to, my exception handlers are often accompanied by angry all-caps comments about how much I hate checked exceptions.

I’m not the only one though; they decided to not have them in C# (see this interview with Anders Hejlsberg) and mr. Thinking in Java, Bruce Eckel, has an essay about why they’re bad.

I decided to suggets that we change the severity of uncaught checked exceptions in eclipse from ‘error’ to ‘ignore’ at work. Unfortunately, it turned out that there was no such option in eclipse, I don’t know why I thought that. Instead, I made a feature request for it in the eclipse bug system (#119230). It only took them a few hours for them to reply: it shouldn’t be possible to configure the eclipse Java compiler so that it accepts code that is illegal by the java language specification. Dammit, that sounds pretty reasonable.

Well, now I’ve filed a feature request at sun’s developer network () but I’m not very optimistic. We’ll see what happens.

Leave a Reply

Your email address will not be published. Required fields are marked *