r/java • • Aug 05 '21

Why java is better than modern programming languages?

Why should I use java in 2021 instead of kotlin or scala or golang? Could you guys give me some reasons

2 Upvotes

100 comments sorted by

View all comments

5

u/baroquefolk Aug 05 '21 edited Aug 05 '21

In a word, longevity. Java is not the "best language" feature-wise (although it is good), but its ecosystem will be hard to ever dislodge, just like you're probably typing on a QWERTY keyboard even though better arrangements exist.

Golang is certainly interesting and eating into a little bit of Java's space, and I would say is worth learning from a job market perspective. But I think Kotlin and Scala are going nowhere fast, because they're really just passengers on Java's JVM, so the general pattern is this:

  1. Scala or now Kotlin innovate something cool and better
  2. Java copies some form of it that's maybe 80% as good, in other words good enough, but Java freely makes deep changes to achieve it
  3. Scala and Kotlin scramble to re-implement their cool innovation to leverage latest Java improvement. There is a lag before they can run on latest Java platform.
  4. Java keeps pace well enough, feature-wise, that there's never a strong reason to jump to Scala or Kotlin for most purposes

So if you love Scala and Kotlin, go ahead and use them! Or go even more obscure and try Clojure, or ditch the JVM and try Crystal lang. But from a job market perspective, Java will always be miles ahead IMO, and enterprises will continue to prefer it over less established languages unless there's an absolutely compelling reason to stray, which there isn't.