When you say Android programming, the chances are that the first programming language that comes to your mind is Java, and rightfully so. But since Google announced they now started to support Kotlin as Android’s official language, the situation is likely to change in the future. Nevertheless, just like Kotlin programming language has raised a few questions.
One of them asked both by seasoned professionals and new entrants on the market for Android apps, is whether it’s smart to make a transition to this latest craze of a language or stick to the traditional and well-known Java.
After weighing all the upsides and downsides of Kotlin here we’ve come up with the following review. We have also got enormous help from Ms. Abby Adams, the senior business analyst at Itransition (a software development company), to find out all bright and dull sides of Kotlin programming language. So, if you consider joining such tech giants as Atlassian, Pivotal, Pinterest, Evernote, and Uber, make sure that you understand all the benefits and possible shortcomings of this language.
The Sunny Side of Kotlin Programming Language
100% Java interoperability
Due to this feature, you can try and launch a pilot programming project on a fraction of your code. In case of success, you could transfer to Kotlin gradually, or introduce Kotlin only in the new components from then on.
Recommended for you: Java Programming: The Core Concepts of Java Development.
Fewer bugs and increased productivity
Also, by being more concise and cleaner, Kotlin enables developers to deliver a more stable code that contains fewer bugs. Also, as all the errors are detected during compilation, Kotlin appears to be safer than Java.
Stress-free learning
Outstanding compatibility with Android Studio
Android Studio can read, compile, and run Kotlin-based code easily. Using it, developers can also fix bugs, use auto-complete, navigate the code, carry out unit testing, and fully refactor Kotlin. Java-to-Kotlin conversion is also possible after your Android Studio project is configured to support Kotlin programming language.
Maturity
Kotlin Programming Language: On the other hand…
Besides all the mentioned advantages, Kotlin has its flaws that need to be taken into consideration before making the transition.
Larger file package size
Compilation speed
Code readability
This simply means that unfamiliar Java code is easier to decipher than that’s unfamiliar in Kotlin.
You may also like: 5 Best Programming Languages for Mobile App Development.
Less professional support yet
Lack of professional workforce
So, is Kotlin programming language better than Java?
That being said, in certain aspects Kotlin is better than Java; in others, it still cannot compete with its predecessor. But will you choose a concise syntax and increased productivity with outstanding Android Studio support over a smaller file package size and faster compilation speed with an established support community? Let’s discuss your opinion on which is better in comments.
Thanks for the article, let me express a different point of view on some of the items.
On the pro side, I’d say on the “stress-free learning” that Kotlin, while being inspired by C# and Java, has a large number of idioms and significant differences in behavior that should not be underestimated, for example, the improved yet different visibility scopes or little things like .equals vs ==. It’s OOP like C# and much more than Java, but you still have to learn the language before hoping to be proficient.
On the con side, I’m not sure this was clearly stated: “downside of Kotlin is its slower compilation speed. Although Kotlin is faster than Java in this regard, sometimes it´s slower indeed.”. Err? Is it slower or faster in the end? What has been demonstrated is that the run-time is usually faster except some features. The slower compilation is not a huge problem, and hopefully, the compiler will get optimized in due time.
Code readability, I think there is no doubt here that Kotlin is actually much clearer than Java. Firstly, it is more concise without being enigmatic – it’s not Perl code. It is possible to write a mess like any other language, but conciseness has never been a synonym of confusing. Secondly, it brings many constructs that would be expressed in lengthy or awkward code in Java, take for instance the default function arguments, or the equivalent of Linq expressions that Java completely botched in version 8, and which is neat and coherent in Kotlin. The only mess they couldn’t fix is type erasure, which was one of the first and biggest mistakes in JVM, and unavoidable for compatibility reasons.
For the rest, package size and adoption, they come together and just need time. One real potential drawback I see is the development being in the hands of one company alone, but like Microsoft with C#, they seem to know what they are doing, so it doesn’t bother me.