A Hitchhiker's Guide to the Functional Exception Handling
summary
Argues that Java exceptions leak control flow and are costly to instantiate because of stacktrace capture, cites a benchmark showing a static stackless exception approach orders-of-magnitude faster, and finds ~600k GitHub occurrences of NoSuchElement-style misuse. Proposes replacing thrown errors with value containers—Optional, Try, Either—and using the functional library waiver to compose recover, map and flatMap chains; shows Java 8-compatible implementations and notes upcoming pattern matching in Java 18 to simplify handling.
AI-written summary · about
chapters (8)
- 0:00Introduction and speaker intro
- 7:59Problems with exceptions in Java
- 15:48Functional approaches to error handling
- 26:29Working with Try in Java
- 31:08Introducing Either for error handling
- 36:10Abuse of exceptions in Java code
- 39:03Key takeaways and summary
- 41:04Q&A session
related talks
44mA Hitchhiker's Guide to the Functional Exception Handling in Java
57mTen Common mistakes made in Functional Java
50mHandling exceptions, the functional way
51mFunctional Programming with Java
36mHow functional programming change my Java code
55mPain-free Functional Programming with Java 21
51mHitchhiker's Guide to Functional Programming
55mFunctional Programming Patterns with Java8
