A deep dive into the pain points of Java's checked exceptions and what could realistically be done to improve them. Rather than rehashing the 'checked exceptions bad' debate, the focus is on actionable improvements: decoupling checkedness from inheritance hierarchies (e.g., via marker interfaces), fixing overly liberal use of checked exceptions in JDK APIs like InputStream.close(), restructuring APIs to isolate error-throwing operations, and relaxing compiler rules around catching exceptions not declared as thrown. The video also explores the role of Either types for deferred computation scenarios like stream pipelines, speculative language features like variadic generics and union types, a JEP draft for switch-based exception handling, and practical style guide recommendations for teams. The core conclusion is that good error handling is inherently hard and no single change will be a silver bullet.
Sort: