Unchecked Java: Say goodbye to checked exceptions
Exception based error handling is so bad and unsafe that adopting functional error handling with Either, Try etc as implemented by functional addon libraries for many languages, while not yet common, in time it will become the new default even in OO languages. (just like it&#x27;s been the default in functional languages for decades)<p>Functional error handling types are much simpler, safer and more powerful.<p>Simpler because they don&#x27;t rely on dedicated syntax- they&#x27;re just regular objects no different to any other object.<p>Safer because unlike exceptions, they force callers to handle all potential outcomes, but no more. (no risk of ignoring errors and no risk of catching a higher level of error than desired, ubiquitous bugs in exception based error handling)<p>Powerful because they support map, flatmap, applicative etc, making it easy to eg chain multiple computations together in desired ways, which is unwieldy and bug prone when using exceptions.<p>&gt; What is wrong about dedicated syntax<p>It adds complexity to the language! It could be that, when learning Java, Kotlin and any other language, we learn that methods return what they say they do... and that&#x27;s that. No weird dedicated syntax and magic, special treatment for returning anything other than the happy path, and the HUGE complexity that comes with it, eg the dedicated syntax itself and how it behaves, differences between checked and unchecked exceptions, hierarchies of exceptions etc etc.<p>&gt; Exceptions are easier<p>But that&#x27;s the point, they&#x27;re not.<p>Exceptions based error handling is unnecessary, hugely complex, doesn&#x27;t compose at all, obfuscates or straight up hides what can go wrong with any given call, so leads to countless trivially preventable bugs... I could go on. And after decades of use, there&#x27;s still no consensus about what exceptions should be or how they should be used. Exceptions are a failed experiment and I have no doubt that in ten years, Java, Kotlin and many other languages will acknowledge as much and move away from it the same way Joda Time outcompeted and replaced the horrible Java date and time library.