DISQUS

Thinking inside a bigger box: A Hopeful Idea: The End of Checked Exceptions?

  • Trond Arve Wasskog · 2 years ago
    Hear hear! Checked exceptions is an abomination. Vote now!
  • Thomas Kjeldahl Nilsson · 2 years ago
    *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?"
  • Sverre H. Huseby · 2 years ago
    As I tend to do what Johannes says, I just voted.
  • Tomas Ekeli · 2 years ago
    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.
  • Johannes Brodwall · 2 years ago
    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?
  • Tomas Ekeli · 2 years ago
    Yes, indeed. You did give me an idea for a post :)
  • Tor Bådshaug · 2 years ago
    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!
  • Bjørn Bjerkeli · 2 years ago
    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.