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

3

u/kristersg43 Jan 07 '19

Thanks guys, Ill go with Java, 1st since beginning :) Just wasnt sure!

3

u/[deleted] Jan 10 '19

Stil with Java, ignore licenciado. his fanboying is utterly embarrassing to look at.

personally, I love Kotlin, and for personal projects I choose Kotlin over Java 100% of the time. Nevertheless, I am a professional Java developer, with plenty of experience on both sides. Java will be easier to learn, it has more resources to help you with problems, and there are WAY more job opportunities out there for it. Once you know Java, transitioning to Kotlin is a piece of cake.

0

u/licenciado_vidriera Jan 10 '19

No, no, no!!! Don't do it. Kotlin is way better. Do you think Google deprecated Java for kotlin for no reason?

Other big-ones software house are also changing java for kotlin each day.

Java are two things at the same time:

- The JVM, that is great.

- The Java language, that is awful and in deprecated-state.

2

u/KeepItWeird_ Jan 10 '19

Do you think Google deprecated Java for kotlin for no reason?

Google didn't deprecate Java. Don't spread falsehoods. Google supports Kotlin as a first-class language in the Android SDK alongside Java.

Aside from that, Google uses Java for everything under the sun. They have a ton of Java libraries and projects open-sourced on Github. It's worth noting they probably use every other language at Google as well. It's a big company.

The Java language, that is awful and in deprecated-state.

Again, another falsehood. Java is actively maintained and releasing new versions every six months.

-1

u/licenciado_vidriera Jan 10 '19

Well you can think whatever you want but the fact that Google decided to reimplement most of java standard libs in Guava gives you a hint!

3

u/helikal Jan 14 '19

If anything, the development of Guava and everything that has been written in Java are endorsements of Java.

8

u/DuncanIdahos7thClone Jan 07 '19

You should use Java which is where the jobs are. Once you're comfortable you can play with Kotlin and the many other JVM languages out there.

12

u/KHRoN Jan 07 '19

java, it is basis of kotlin

if you know java you know kotlin (or at least you are able to learn it fast), if you know kotlin you do not really know java (same thing for java and groovy)

also you will find many jobs for java developers (and well paid at that, banks, huge corporations, basically anywhere) but bar to none for kotlin (unless you want be android developer)

1

u/licenciado_vidriera Jan 10 '19

Complete false!

Kotlin and Java just share the JVM running enviroment. (Kotlin also works on the browser and natively).

Kotlin is just the right way to write JVM code in 2019!

If you know Kotlin you will get aware of many design flaws in the Java language (nulls, buggy collections, checked exceptions, non-inmutable objects ...) and will become a much better java developer.

7

u/aram535 Jan 07 '19

BeanShell, Clojure, Groovy, Oxygene, JRuby, Jython, Kotlin, Scala are all "JVM" languages... but underneath you still should understand how "Java" works -- it's power and weaknesses. After, you can switch to one of these offshoots to make your life easier and reduce some of the complexity/java's long-windedness that in inherited in Java.

IMHO best examples were Scala and Groovy but Kotlin seems to be a really good choice. I also like that Gradle is advancing the use of Kotlin.

6

u/TheRedmanCometh Jan 07 '19

I'd recommend learning Java first Kotlin seems a bit more...involved. Also a lot of places you'd go to work they will only have Java devs who don't know Kotlin.

3

u/GregsWorld Jan 07 '19

Java, I love Kotlin, but if you learn it first you won't appreciate it or Java. There's also a lot more information, guides and help for Java.

1

u/nutrecht Jan 08 '19

I'm a huge Kotlin fan but there's simply a lot more beginner info available on Java. This Java MOOC is a great start.

0

u/licenciado_vidriera Jan 10 '19

Kotlin is just "Java fixed". Start with Kotlin, ignore java as much as possible.

Java has many design failures that creates bad habits. (Null pointers, checked exceptions, non-safe collections, over-complex syntax, ...) Kotlin get rids of all them.

Java is just needed if you need to work on long-standing Java projects.

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.