by bitL · 6y ago · 0 comments
For instance, in Kotlin you can perform operations on collection without converting them to a stream first, and collecting them with a certain collector afterwards. So in order to perform a single filtering operation on a collection, you need to do three steps in Java and just one in Kotlin.
Another advantage is coroutines, which not only allow you to write asynchronous code in a common, synchronous manner, but also get rid of shared mutable state, since coroutines can send/receive shared state through channels.
E.g. if you want to parse a CSV or JSON, you would google "how to parse it in Java", not "... in Kotlin". That's different, from e.g. Scala, where everything should be Scala-way (of course you could use Java libs in Scala, but it was always second-class I feel).
Also it is funny to see how Kotlin or Swift are marketed as simple languages when they managed to literally copy 90%+ of Scala features and make some actually even more complex (eg nullability).
If you say "overcomplicated" it suggests you have a simpler solution for the same problem in mind. So, what exactly would you simplify in Scala? Which unnecessary features would you remove? It is easy to throw an "X is overcomplicated" statement but much harder to point to concrete things that could be done differently. Sure, some stuff could be easily removed, but not without making the language less expressive.
Scala standard library is a bit in the baroque side, but it has been simplified recently in 2.13.
That. There's no "Kotlin way", there's only Java way. That's what I mean.