Author: Karsten Silz
Jun 1, 2022   |  updated Jul 6, 2022 6 min read

Permalink: https://betterprojectsfaster.com/guide/java-full-stack-report-2022-06/lang/

Java Full-Stack Index June 2022: JVM Languages


This is an old version! Click below for the current one.

See Current Version


Summary

  • Popularity trend: Java is #1, Kotlin #2, and Scala #3. Java leads Kotlin by an order of magnitude in job ad mentions, Udemy students, and Google searches. In questions at Stack Overflow, Java leads 5:1. Scala is #2 in job ad mentions if explosive numbers from Japan are used and #3 if not.
  • On your current project, keep your existing language unless that language is absolutely, really not working out for you.
  • If you need to switch languages or are on a new project:
    • Use Scala if you need functional programming.
    • Use Kotlin if you really need a “more modern Java”.
    • Otherwise, use the latest Java LTS version you, your team, and your application can take.

Archive

May 2022 April 2022 March 2022 February 2022 January 2022 December 2021 November 2021

Table Of Contents

Applications

These recommendations are for building enterprise applications on PCs and mobile devices - forms, data grids, reports. They are not for games or media applications.

Choices

Here are the choices in alphabetical order:

Popularity

Why Popularity - and How?

Picking a popular technology makes our developer life easier: Easier to learn, easier to build, debug & deploy, easier to hire, and easier to convince teammates & bosses. Now popularity can make a difference in two situations: When multiple technologies score the same, we could go for the most popular one. And when a technology is very unpopular, we may not use it.

I measure popularity among employers and developers as the trend between competing technologies. I count mentions in job ads at Indeed for employer popularity. For developer popularity, I use Google searches, Udemy course buyers, and Stack Overflow questions.

Employers: Job Ads

The Indeed job search is active in 62 countries representing 89% of the worldwide GDP in 2020. It demonstrates the willingness of organizations to pay for technology - the strongest indicator of popularity in my mind. Kotlin is the baseline.

Job ad mentions at Indeed for Java and Kotlin
Job ad mentions at Indeed for Java and Kotlin

And here are the remaining languages:

Job ad mentions at Indeed for Clojure, Groovy, Kotlin, and Scala
Job ad mentions at Indeed for Clojure, Groovy, Kotlin, and Scala

Java wins by an order of magnitude, Scala may be second, and Kotlin is third. I’m skeptical of Scala’s numbers: It made an improbable jump from 89% of Kotlin’s mentions to 157%! And all of that comes from Japan, where Scala exploded from 4k to 36k! The numbers seem legit, but I’ll keep an eye on this. Without this “Japan boost”, Scala would be at 88% of Kotlin’s mentions. Groovy has a fifth of Kotlin’s number while Clojure is last. Kotlin lost 22% compared to March, wiping out all gains against Java & Scala since last October. But it’s slowly recovering. Even Groovy gained against Kotlin as a result.

Please see here for details, caveats, and adjustments of the job ad mentions.

You can find the detailed search results with links here. They include breakdowns by continents:

Developers

Google Searches

Google Trends demonstrates the initial interest in a technology over time:

Google Trends for Clojure, Groovy, Java, Kotlin, Scala
Google Trends for Clojure, Groovy, Java, Kotlin, Scala

This link produces the chart above.

Even at 1/8 of its peak interest in 2004, Java still beats Kotlin 12:1. Its decline may have stopped.

To get a better picture of the Java alternatives, here they are without Java:

Google Trends for Clojure, Groovy, Kotlin, Scala
Google Trends for Clojure, Groovy, Kotlin, Scala

This link produces the chart above.

Among the Java challengers, Kotlin wins, Scala is second, Groovy third, and Clojure last. We can see the fall of Scala and the rise of Kotlin, both starting five years ago. Kotlin peaked in July 2020 and is now back to its level from three years ago. After stabilizing a year ago, Scala may take a dive again. Groovy has declined for nearly three years, while Clojure has for almost four years.

Students at Udemy

Udemy is one of the biggest online learning sites. They publish the number of courses and students beyond a certain threshold (possibly around 100,000 students). This shows how many people evaluate a technology. Kotlin is the baseline.

Students at Udemy for Java, Kotlin, Scala
Students at Udemy for Java, Kotlin, Scala

Java wins by an order of magnitude, Kotlin is second, and Scala is third. Java, Kotlin, and Scala are stable. Both Groovy and Clojure don’t have enough students to cross the display threshold.

Here are the links that show the courses for all and the number of students for some:

Questions at Stack Overflow

Stack Overflow Trends shows which percentage of questions at Stack Overflow has a particular technology tag. It is a proxy for using a technology during evaluation and productive use. “More questions = better” to me.

Questions at Stack Overflow for Clojure, Groovy, Java, Kotlin, Scala
Questions at Stack Overflow for Clojure, Groovy, Java, Kotlin, Scala

This link produces the chart above.

Java wins, Kotlin is second, Scala third. After a five-year rise, Kotlin seems to plateau at a fifth of Java’s question volume. Java has lost nearly half its questions in the last seven years, while Scala lost more than half over the previous five years. Groovy and Clojure have hovered just above zero for as long as Stack Overflow has existed.

Analysis

  • Usage of Java still dominates its alternatives, often by an order of magnitude.
  • The evolution speed of the Java languages has increased. So even staying with the incumbent Java makes life for us developers easier.
  • If Oracle gets its will, then we’ll get a new Java LTS every two years instead of every three years. This would speed up the delivery of Java language improvements.
  • Kotlin is the best Java alternative. I believe that Kotlin’s rise in popularity is in part fueled by its status as the default language for Android development.
  • Scala lost its position as the #2 JVM language. In job ads, it’s still neck-to-neck with Kotlin and even comfortably ahead of it in places like North America (where it leads Kotlin 2:1). But Kotlin leads globally in job ads. And Google searches and Stack Overflow questions also trend towards Kotlin. That’s why Scala is #3 for me.
  • There’s one overwriting factor that requires Scala: functional programming. If that’s your need, you have to use Scala on the JVM.
  • Groovy is a has-been on the JVM: Kotlin stole its place of “better Java”, while Grails (Ruby-on-Rails with Groovy on the JVM) has fallen out of favor. I know that the Tiobe Index places Groovy way ahead of other JVM language alternatives to Java, but I think that view is rather exclusive to Tiobe.
  • Clojure fills the niche of “Lisp on the JVM”.

Here’s my recommendation:

  • On your current project, keep your existing language unless that language is absolutely, really not working out for you.
  • If you need to switch languages or are on a new project:
    • Use Scala if you need functional programming.
    • Use Kotlin if you really need a “more modern Java”.
    • Otherwise, use the latest Java LTS version you, your team, and your application can take.

comments powered by Disqus