2 ms·
Really? Exceptions introduce some sort of magic in control flow, it is simply less explicit. It may come in handy, but I rather use it as a final resort than as
by cies 7y ago
Really? Exceptions introduce some sort of magic in control flow, it is simply less explicit. It may come in handy, but I rather use it as a final resort than as a way to return different types (I've seen exceptions being used in Java for non-error cases I guess because sum-types (aka tagged unions) are not available).
Having this (together with pattern matching) as the-way-to-do-errors in Kotlin is one of the main reasons I feel it fixes what Java cannot (easily) fix.
Can you articulate how it increases readability?