Kotlin Is Far Better than Java

I’ll tell you their difference in plain English.

Josef Cruz
4 min readMay 12, 2022
Photo by Stillness InMotion on Unsplash

Kotlin and Java come from a common ecosystem on top of the Java Virtual Machine. However, Kotlin has expanded beyond this ecosystem into areas Java cannot serve.

And with that, we have the first difference between Kotlin and Java. Java and the JVM are not just siblings. They are Conjoined twins that influence each other. Java is the only programming language whose further development directly leaves traces in the JVM.

Kotlin, therefore, has to live with some limitations internally. While the language does this very well, you occasionally find some oddities that you wouldn’t expect if Kotlin were completely independent.

An example of this is the top-level and file-level elements that Kotlin offers. Unfortunately, Java only allows classes and interfaces on these levels (strictly speaking, the modular system is no longer correct either).

Kotlin solves this by automatically ending up everything declared at the file level in a class with a KT suffix. Of course, Kotlin hides this from the programmer, and within Kotlin, it’s completely irrelevant, but if you’re using Kotlin with other systems, you might also need to know that.

--

--

Josef Cruz

Entrepreneur, coder, husband, father. I spend my days on the web learning and sharing information across the globe.