Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 27
    "The price of checked exceptions is an Open/Closed Principle violation. If you throw a checked exception from a method in your code and the catch is three levels above, you must declare that exception in the signature of each method between you and the catch. This means that a change at a low level of the software can force signature changes on many higher levels." —Robert C. Martin, «Clean Code», page 107 Commented Nov 9, 2014 at 11:10
  • 10
    It's interesting to note that Jim Waldo rants against unchecked exceptions in "Java: The Good Parts" shop.oreilly.com/product/9780596803742.do saying that adult programmers should only throw checked exceptions. We read it in our JUG only 6 years ago when it came out and it seemed like good advice! Now, with functional programming, checked exceptions are completely unwieldy. Languages like Scala and Kotlin don't even have them. I've started wrapping checked in unchecked exceptions too. Commented Jun 28, 2016 at 13:57
  • 1
    @GlenPeterson you also have the advice in FP to avoid execetions altogether and use sum types instead Commented Mar 27, 2018 at 12:35
  • 1
    @Songo that isn't particularly true, you can wrap an underlying implementation's exceptions with your own layer's exceptions, and propagate these. Commented Jun 24, 2018 at 8:01
  • 1
    2019 Answer: Your college was 100% right in doing it. Commented Jul 23, 2019 at 10:54