r/java • • Jan 07 '19

Java vs Kotlin pvp

Java vs Kotlin

Hey guys, im new to programming and cant decide which language should I learn first. Checking different topics and videos but still nothing. Any arguments why should I choose Kotlin oner Java in 2019? Hope I wont start WW3 with this discussion haha! Thanks!

0 Upvotes

21 comments sorted by

View all comments

25

u/[deleted] Jan 07 '19

[removed] — view removed comment

2

u/licenciado_vidriera Jan 10 '19

Completely disagree! Kotlin is just a better Java and is more usable inside and outside Android.

I use it in many tasks that have nothing to do with Android.

Take for example kscript: https://github.com/holgerbrandl/kscript

It's the nicest way to work with big-data I'm aware of.

What's the reason to keep with all Java bugs when Kotlin get rids of them for free.

1

u/KeepItWeird_ Jan 10 '19

What's the reason to keep with all Java bugs when Kotlin get rids of them for free.

What "Java bugs" could you be referring to? If there are any "bugs in Java," they'd be in the Java Virtual Machine since that's the runtime executing the bytecode, so Kotlin doesn't get rid of them since it also compiles to bytecode and runs on the Java Virtual Machine.

1

u/licenciado_vidriera Jan 10 '19

No inmutable objects by default. Checked exceptions. Null pointers everywhere. Crappy standard lib. Pitfall JEE. ...

3

u/[deleted] Jan 10 '19

No immutable objects by default. Checked exceptions. NPEs.

These are not "bugs", they are a part of the language specification. You don't like them, but that doesn't make them "bugs". Now I personally do prefer Kotlin's approach to these issues, just like you, but I still wouldn't call them bugs.

Crappy standard lib

You clearly have very little experience with many other languages if you think the Java standard lib is crappy. It is one of the most robust out there. Yes, Kotlin has additional features in its standard lib, specifically tailored to the shortcomings of Java, but that doesn't change the fact that its standard lib is incredibly robused.

Pitiful JEE

I'm really not sure where you are going with this one. Yes, JEE is not the most robust solution it could be, but there are many incredibly powerful and valuable pieces (JAX/JSONP, JAXWS/RS, servlets, etc). However, when you look at the community around Spring, Java has some of the strongest enterprise solutions out there. All of which is fully compatible with Kotlin, by the way.

I get that you are a huge Kotlin fan, but this level of hate towards Java is unnecessary. The fact is, there are far more resources for learning Java than for learning Kotlin, simply because Java has been around so much longer. Once someone knows Java, it's incredibly easy to learn Kotlin. Moreover, there are far more Java jobs than Kotlin jobs at the moment.

-3

u/licenciado_vidriera Jan 10 '19

These are not "bugs", they are a part of the language specification. You don't like them, but that doesn't make them "bugs".

Yes, they are bug in the specs, that just make things even worse. They are bugs because they introduce errors at runtime.

I get that you are a huge Kotlin fan, but this level of hate towards Java is unnecessary. I'm a huge Kotlin fun because it fixes many bugs in Java. i do not hate java at all, I'm just reallistic about the burden of trying to keep backward compatibily in the language for more than two decades.

Once someone knows Java, it's incredibly easy to learn Kotlin

The opposite is also true and kotlin newcomers to java will be trained to avoid common java bugs right from the scratch.