5 ms·
My biggest pet peeve with Kotlin is that they got rid of checked exceptions and replaced them with nothing at all. All error code flow is now just invisible unc
by LinXitoW 2y ago
My biggest pet peeve with Kotlin is that they got rid of checked exceptions and replaced them with nothing at all. All error code flow is now just invisible unchecked exceptions, the single worst kind of error handling imaginable.
I know they added the Result type later on, but there's zero convenience to it, so you have to manually handle every error, even if you just want to bubble it.
Checked Exceptions were better, though Rust still has the best error handling in any non-functional language.
- bberrry 2y agoDepends on what you're writing I guess (as always). I write backend services and if there is an exception thrown, generally the whole request is forfeit. So a top-level exception handler is all that's needed.. no checked exceptions ruining my lambdas or streams like in Java.
- t-writescode 2y agoNot to mention a top-level exception system is a great place to put the db transaction rollback so everything’s always undone (some exceptions apply)