4 ms·
Most other languages agree that checked exceptions are not good by not having them. As for alternatives, Try/Result and similar monads have decent adoption eve
by dtech 3y ago
Most other languages agree that checked exceptions are not good by not having them.
As for alternatives, Try/Result and similar monads have decent adoption even in Java, but personally I quite like the Kotlin philosophy [1] to not have generic error containers and either use runtime exceptions for errors that cannot be reasonably handled by the caller and encapsulate failures in the return type if they can.
[1] https://github.com/Kotlin/KEEP/blob/master/proposals/stdlib/result.md#error-handling-style-and-exceptions https://github.com/Kotlin/KEEP/blob/master/proposals/stdlib/...