2 ms·
> Can someone convince me to still use Scala when Kotlin is around? I probably can't, but several things about Kotlin have annoyed me. The main thing, coming f
by kodablah 10y ago
> Can someone convince me to still use Scala when Kotlin is around?
I probably can't, but several things about Kotlin have annoyed me. The main thing, coming from Scala, is lack of library-based Option as opposed to compiler null-checking enforcement. Sure Kotlin talks about the lack of overhead compared to an Option instance (or Optional in the Java 8 case) but the fact that I have to use imperative tools (if/else, etc) to do some of the functional things I might want to do (flatMap, treat as single-element collection, etc) drives me nuts.
Also, for the longest time I couldn't even have a sealed data class hierarchy (i.e. ADTs) but I think that is being remedied. I have also run into bugs where their insistence on limited operator overloads causes ambiguity with overload resolution [0]. I could go on and on having written both a lot (but less Kotlin lately) but not sure this is the best forum for comparing. I might not convince you that Kotlin's downsides compared to Scala outweigh its upsides, but we can't pretend downsides don't exist.
0 - https://youtrack.jetbrains.com/issue/KT-9992 https://youtrack.jetbrains.com/issue/KT-9992