DISQUS

DISQUS Hello! Thinking inside a bigger box is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Jump to original thread »
Author

A Hopeful Idea: The End of Checked Exceptions?

Started by jhannes · 10 months ago

Java.net’s latest poll asks: should checked exceptions be removed from the Java language. Sadly, the poll is not going the way it should right now. Many people feel checked exceptions are key to reliable programming. They are wrong. Please: Read this post, and help improve the Ja ... Continue reading »

8 comments

  • Hear hear! Checked exceptions is an abomination. Vote now!
  • *Voted*
    Checked exceptions = one of the more annoying java quirks after I got back into other languages on a daily basis. "Why do I have to deal with this crap?"
  • As I tend to do what Johannes says, I just voted.
  • You make good points, in a shout-it-from-the-mountains kind of way. I don't agree with you, but you make good points.
  • Hi, Tomas

    Thanks for the comment and for the kind words. I take it that you have a different experience? I understand from your blog that you also program .NET Maybe you have a good story on what kind of problems you run into that would've been avoided with checked exceptions?
  • Yes, indeed. You did give me an idea for a post :)
  • I couldn't agree more, I think checked exception promotes bad code, like the buggy or "noisy" catch blocks mentioned.
    Also, to my experience, when repeatedly faced with the annoying "catch or throw"-complains from the compiler, most developers tend to find the quickest device to make those annoyances go away, such as an empty catch-block (ugh) or just use a throws declaration.

    Speaking about throws declarations - you can choose whether to make them specific or general. Specific will tend to be implementation dependent, which is problematic for loosely coupled, interface-based architectures (as discussed here http://radio.weblogs.com/0122027/stories/2003/0...). It also raises versioning and compability issues.

    General throws declarations (like throws Exception) just defeats the concept. That's like implicit anyway if they were unchecked in the first place.

    Most definitely a vote from me!
  • Hi have been arguing for a long time, and I think most of us (that actually program i java, not just read articles bout it) agree that checked exceptions ar bad. Pretty disappointing to see however how the poll acually goes in favor of keeping them.

    It seems that one of the major problems that the java-community is facing, is that devlopers tend to argue in favor of something that seems to be good in theory but that doesn't necessarily work in practice. We need to keep this in mind, and we need write code and read code to actually understand this.

Add New Comment

Returning? Login