The funny Java vs Kotlin battle
Tags: java, kotlin, android, jvm
Published: 2019-05-14 18:39:21

---
title: The funny Java vs Kotlin battle
published: true
description: Don't talk down on one language to rise another
tags: #java #kotlin #android #jvm
cover_image: https://thepracticaldev.s3.amazonaws.com/i/km2vekyyqgaw81idyv9a.jpeg
---

Scrolling through Twitter I found this Tweet which I kinda agree with:
{% twitter 1128026975694536704 %}

I went on to check out the [Reddit Post](https://www.reddit.com/r/androiddev/comments/bo2b27/anyone_else_prefer_java_over_kotlin/) spoken of. 

Here is my take on what I saw.

In the Android community, there is this constant battle of Java and Kotlin which, in my opinion, is very unnecessary. 

I use both Java and Kotlin and can say that Kotlin is a wonderful language.

But here is the issue, to uplift a language, you do not need to talk down on another. If a tool is solid and stands the test of time, people would adopt it. 

Another mistake I see is when people compare Kotlin's current features with Java's past issues.

What do I mean by that? 

When people compare Kotlin with Java they, sometimes unknowingly, are comparing **Kotlin** with **Java 7**. 

*In case you are not aware, the latest Java version is Java 12.* 

The Java used on Android is mainly Java 7 and a little of Java 8. Java 8 features are now being added to Android for developers to make use of. 

If you are familiar with Android development you would know that in order to use *Java Streams*, which was a feature in **Java 8 (2014)**, you would need to be on **API level 24** or higher to use it on Android. 

For clarity sake, API level 24 is *Android Nougat*. 

Another Java 8 feature ([which you can now access on Android](https://developer.android.com/reference/java/util/concurrent/CompletableFuture)) is CompletableFutures which could replace all the lines of your AsyncTask Class with just a few lines of code. 

If you have noticed, I haven't spoken of the current Java 12 features. It is possible to see Java 12 code and mistakenly think it is Kotlin, that's how much Java has improved. 

I am also a Kotlin fan. If you would like to know more about Kotlin check out the [Kotlin in Action](https://www.manning.com/books/kotlin-in-action) ebook.

But being a fan of one language shouldn’t make you an enemy of another. 

The common arguments I hear are readability and productivity. If you want to read a great article on why Kotlin does not instantly mean readability and productivity [read this article](https://www.techyourchance.com/kotlin-vs-java-whole-story/). 

Adopting Kotlin does not guarantee you would have happier developers, fewer bugs and skyrocketing profit. In the end, the users/clients might not even know or care about what an *If Statement* means. 

If you are using Java on Android, Awesome! 
Also check out [RxJava for Android Developers](https://www.manning.com/books/rxjava-for-android-developers).

If you are using Kotlin, keep it up!

If you wrote the app using C++ and it works fine as expected, great! 
If you wrote it using React native, wonderful! 
If you wrote it with Flutter, marvellous!


We like shiny new tools. We should also focus on getting the job done and maintainable. 

Shorter lines of code (especially when not significant) do not guarantee the project would be delivered faster. Readability is subjective and any statistics on productivity should be based on facts.

Happy coding!