2 ms·
I think the question should be why Kotlin instead of Java because it provides part of the answer. When I switched to Kotlin, I liked some nice things, but foun
by jollybean 5y ago
I think the question should be why Kotlin instead of Java because it provides part of the answer.
When I switched to Kotlin, I liked some nice things, but found that in the big picture, it wasn't a huge advantage, and many of the language artifacts I didn't like.
Most importantly: Kotlin doesn't produce more succinct code. The code is not really that much shorter. If you go to Android and look at all the Java/Kotlin examples, they are almost always similar in terms of length and complexity.
Once you find yourself dealing in an entirely Java world, with Java idioms, libraries, builds, jars and reading java source ... the bit of 'impedance mismatch' to your own Kotlin code then becomes a pain.
Kotlin is no way better than having to work in 'two languages at once' with the constant switching. And of course a whole bunch of extra tools as well.
Also, Kotlin is more of a 'bunch of features' than a cleanly designed language.
So in the end if you are using K for a very specific reason (maybe js compile target), or if you can do the whole project cleanly in K (maybe Android) etc. then maybe K is the choice.
But I've switched back to Java and accepted slightly more verbose typing and never missed it. The IDE's do a lot of that work anyhow.
Even more qualitative ... I find Java easier to read and maintain for some reason.
I would almost prefer a few small changes to Java than I would a new language.