Back to Java User Group Home Print this page

Java User Group

April 2017 Meeting Information

April 11, 2017
Exceptions: I'm Telling You for the Last Time

We are happy to announce that Elliotte Rusty Harold will be our special guest for this month's meeting.

No feature of the Java programming language is as original or as misused and controversial as exception handling. More than twenty years after Java was introduced more developers don't understand exceptions than do. That's not surprising given that most textbooks and tutorials get exceptions seriously wrong by focusing on the rules you must follow rather than the reasons you should follow them.

And yet just three rules cover 99% of what you need to know about exceptions:
  • Separate exception handling from the main path by making try blocks as long as possible.
  • Use checked exceptions for environmental problems and runtime exceptions for programming errors.
  • Bubble exceptions you can't handle.

Follow these simple principles; and your programs, libraries, and APIs will be cleaner, simpler, and more robust.

Finally, Elliotte will talk about the one reason you may not want to use exceptions at all.