Skip to main content

Dissidents

Posted by editor on June 22, 2007 at 7:21 AM PDT


The movement to overthrow Java's checked exceptions

So over the last few weeks, we've covered the debate in the community over the idea of ditching checked exceptions. Some developers have complained about checked exceptions over the years, but so far, it's mostly just been talk. Every now and then, you see frameworks where all the exceptions are RuntimeExceptions, and thus don't require handling, but it seems like those speaking most strongly against checked exceptions have moved on to other languages, often highly dynamic languages where checked exceptions don't make sense anyways.

But recently, Neal Gafter openly explored the idea of removing checked exceptions from Java, in response to a suggestion from a colleague who noted that much of the complexity in Gafter's closure proposal came from reconciling closures with checked exceptions. That got a strong reply from Elliotte Rusty Harold, whose Voting for Checked Exceptions calls the very idea a "hideous idea from the closures camp." Elliotte continues:

The people who object to checked exceptions mostly seem not to know the difference between checked and unchecked. Most importantly, they seem not to know when to use checked exceptions and when to use unchecked exceptions. A few libraries such as the Java USB API even get this exactly backwards. And I will admit, if you don