Women in Technology

Hear us Roar



Article:
  What I Hate About Your Programming Language
Subject:   Java + Exceptions
Date:   2003-05-15 02:03:11
From:   anonymous2
Response to: Java + Exceptions

No you clearly do not know what you are doing. The whole point of checked exceptions is that the compiler can help verify that you are not forgetting to handle them.


You have to catch the FileNotFoundException somewhere... might as well make the code clear as to what is going on.


If you are happy to have your program exit with a stack trace... then you really really do not have a clue as to what you are doing.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Java + Exceptions
    2003-05-15 10:11:33  chromatic | O'Reilly AuthorO'Reilly Blogger [View]

    Yes, that's exactly my gripe.

    If I don't think a missing file is an exceptional condition within the current program, I don't really have the option to ignore FileNotFoundException. I either catch it explicitly or let it propogate upwards and crash with a stack trace.

    I'd like to be able to ignore (as in, "not have to write any code to tell the language not to do something") certain exceptions sometimes. I don't have that option in Java, unless I do a bit of metaprogramming or rethrow exceptions as run-time exceptions, or some other technique.

    The problem with a mandatory, checked exception system is that what Sun thinks are exceptional conditions are not always what I think are exceptional conditions in certain situations.