DEV Community

Cover image for The funny Java vs Kotlin battle

The funny Java vs Kotlin battle

Lemuel Ogbunude on May 14, 2019

Scrolling through Twitter I found this Tweet which I kinda agree with: Vasiliy Zukanov @vasi...
Collapse
 
eljayadobe profile image
Eljay-Adobe

Well said! Languages are tools. The tools are either suitable or less-than-suitable for a given problem domain.

Java and Kotlin are both very mature, successful languages, on JVM which is an amazing platform. (And the IDE tools available with the refactoring power is jaw-droppingly wonderful.)

I sort of liken the Java/Kotlin battle like the Java/C# battle. Same story, once again. Java on JVM is successful, with wonderful tools. And C# on .NET is successful, with wonderful tools.

Which tool to use, for which platform, really depends on the problem trying to be solved and for what target audience, and with what kind of deployment model.

Everything in the top 50 of the TIOBE Index charts is easily a winner, as a reflection of the industry.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

I couldn't agree more!

Also, the battle is kinda healthy for the languages to keep up and not slack.

Collapse
 
rcosteira79 profile image
Ricardo Costeira

I completely agree with you. I used Java for a long time, and Kotlin was a breath of fresh air. Especially since we can't use Java 9 and above on Android. However, I had moments where I was solving a given problem in Kotlin and thought "Eh, this would've been easier/more straightforward to do in Java", and that's OK. Both languages have their pros and cons, but ultimately both are means to an end. People seem to easily forget that we could already do amazing stuff with Java, long before Kotlin even existed.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Exactly. You have spoken the truth.

Collapse
 
croxx5f profile image
croxx

I love Kotlin, and it introduced me to a whole new set of features i could not have dreamed in java(altough java is not lagging behind anymore). But let us not forget that if Kotlin is so great is mostly because Java JVM , libraries and community are great. And Java isnt going anywhere

Collapse
 
_hs_ profile image
HS

It's too much this vs that in software and it's only getting worse lately. Take for example C# it's like Kotlin guys. Just hate the Java all the way and compare previous issues with current features of opposite program. And it's worse on global scale now FP vs OOP. Well in case FP people forgot a lot of things they use are built with OOP style. Although on both sides there are people who start this talk down on "opposite" side in my experience it's usually anti-Java people and FP people who start useless discussions.

Comparing things is extremely useful for learning but why think it's the only approach if you like it? This is kind of getting religiously extreme. Scala is good example how to p**s of everyone. It's useful it provides both FP and OOP and does not exclude something just because some programming ideology think it's bad it lets you make the decision. It should be also with the languages and tech in general. The best programming language/paradigm, framework, OS... is the one that gets the job done (or the one that makes you more money :D )

Collapse
 
lankydandev profile image
Dan Newton

I agree with this. I also prefer Kotlin at the moment and get to use it at work but do feel like Java gets pooped on a lot.

It's not that bad I'm fine with it but I definitely would rather use Kotlin over it at the moment.

That said, like you also mentioned. I haven't even tried java 10+ yet. It's getting better but I don't think it's there yet.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude • Edited

Yes, Kotlin is really nice.

Unfortunately, as you said, some people talk down on Java more than is needed.

Collapse
 
dmahely profile image
Doaa Mahely

Kotlin does sound really cool. I personally haven't tried it yet.
When it was decided to do an Android app for our graduation project, my colleague suggested using Kotlin, but I thought we should leverage our knowledge in Java as it was the first language we learned at university and the one we took the most courses in, and it has served us well!

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

That's great!

Collapse
 
blessedmedia profile image
Blessedmedia • Edited

Great I develop with kotlin,I will comment that it fantastic nonetheless Java is quite good and has a strong community.The developers of both languages do not need to panic because they similar and easy to switch my advise is that it better to work smart than hard

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

Well said!

Collapse
 
jbristow profile image
Jon Bristow

Streams and lambdas are awful in Java 8. Completable Futures are... ok, but way more complicated than coroutines. Java’s type system is way less safe... I don’t need to compare kotlin to 7... 8 is bad enough.

Collapse
 
redhoodjt1988 profile image
Jonathan Reeves

Well said sir. I agree. I have been using Java and Kotlin both now for awhile and I have to say that I don't prefer one over the other and of I did I would not speak negatively of the other. It serves no purpose to condemn a language because you use/like/love a different one.

Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard • Edited

Hello you are right.
Kotlin is great and Java is good.

In fact the thing that made Andorid looks extra bad to me is Android.

And more specifically the way the Android team taught us to do Java.

  • Java 7.5
  • No typesafety anywhere
  • Lots of bad recommendations in the name of performance
  • Enums were supposed to be avoided (remember?)
  • God objects that do everything
  • Poor API designs
  • Poor Android documentation

So Java on Android as taught by Google sucks a lot.

Java itself deserves our praise

Collapse
 
roargronmo profile image
Roar Grønmo

It's like spoken languages:
Norwegian, Swedish and Danish are so like they can be understood by each other...
English have many country adaptions.
German is strictly
Italian is fast...
Swahili... I don't know any...

Collapse
 
xowap profile image
Rémy 🤖

Java makes me want to slit my throat open and Kotlin not, what can I say 🤷‍♂️

I guess that everyone is entitled to have an opinion at some point.

Collapse
 
engmms profile image
engmms

really Good Topic

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude • Edited

If you're interested in some more info, check out this article by Jake Wharton on Android's Java 8 Support

Collapse
 
ronjdaugherty34 profile image
Ronald Daugherty

I'm bias because I really didn't how understand programming Android apps till I started to use Kotlin.

Collapse
 
lemuelogbunude profile image
Lemuel Ogbunude

That's understandable and fine. There is absolutely no fault there.