DEV Community

Discussion on: 10 reasons to switch from Java to Kotlin right now!

robole profile image
Rob OLeary • Edited on

Interesting read. I understand the benefits of Kotlin, but the payoffs don't seem to be big for developers who have experience with Java already. What people forget that there are many JVM languages such as Groovy, Scala, Clojure...etc, and I think that diversity is cool, but most of these languages are offering something quite different than Java e.g. Groovy is dynamic and good for scripting..etc. Kotlin seems the most like Java, but it's biggest selling point is less boilerplate.

What is different than the other JVM languages is that Kotlin has the most mainstream traction. This seems to be mostly because Google promotes it for Android development. I was learning some Android programming and I found it muddied the waters that tutorials and examples are mix of Java and Kotlin. If you consider that Java adopted some features from other languages in later versions, I feel it hurts education and adoption in the long-run if there is a migration. If you learn Java in university and companies are mostly using Kotlin, it's making it a longer path for people starting off.

I haven't delved into Kotlin, so I don't want to show bias, but based on what I know now - I would learn Scala over Kotlin. You gain more from delving into a different programming paradigm and using a language that has different applications.

vngantk profile image
Vincent Ngan

Kotlin is very different from other JVM languages, not because it has anything very special as compared to others. It is because it is a very practical alternative to Java. Groovy and Clojure are dynamic typed and Scala though it is more advanced but just too complex for many people. When you switch to Kotlin, you immediate enjoy all benefits of Kotlin without worrying any compatibility issues with your favourite Java frameworks, Spring, etc. They all work flawlessly in Kotlin. If you have knowledge about Java, the learning curve of Kotlin is very minimal. If you don't bother to learn anything new in Kotlin, you can simply write a Kotlin program that looks very similar to a Java one (with just some minor differences in syntax). You can also keep your existing Java code. The Kotlin compiler compile Java code too, so you can keep your existing Java source files along with your new Kotlin source files in the same project.