Hacker News new | ask | show | jobs
by michaelbull 791 days ago
> Unless JetBrains rolls out language support for something like Rust’s Result, exceptions are superior and Kotlin community would better off embracing them instead of trying to be different for the sake of being different.

If this was true, why do Jetbrains themselves keep reinventing their own per-domain Result classes for their new code? For example, in their coroutines library they invented another Result type specifically for Channels[1] and isn't interoperable at all with their other Result type[2] that was also originally written to facilitate some of the coroutines code.

If Jetbrains' own internal library authors keep reaching for a Result type then I think we're better off following suit, because if they thought exceptions were superior in this example, they would have used them.

[1] https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-corout...

[2] https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/