Java Full-Stack Index Nov 2021: JVM Languages
Summary
- 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.
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 I look at technology popularity as a funnel from interest to learning, application, and finally to skill:
- Quantity decreases in the funnel - we’re interested in many technologies, but few end up on our resumes.
- Time increases in the funnel - it takes many months, often years, for technology to move from “interest” to “skill”.
We’re interested in the trend of the ratio between competing technologies. So we use Google searches to measure interest, Udemy course buyers to measure learning, Stack Overflow questions to measure learning & application, and mentions in Indeed job ads to measure skills.
Google Searches
Google Trends demonstrates the initial interest in a technology over time:
Even at 1/8 of its peak interest in 2004, Java still towers over all its JVM alternatives. This link produces the chart above.
To get a better picture of the Java alternatives, here they are without Java over the last five years:
Kotlin wins, Scala is second, Groovy third, and Clojure last. We can see the fall of Scala and rise of Kotlin. This link produces the chart above.
Students at Udemy
Udemy is one of the biggest online learning sites. They publish the number of courses and the number of students (if it goes beyond a certain threshold). This shows how many people evaluate a technology. Kotlin is the baseline.
Java wins by an order of magnitude, Kotlin is second, and Scala is third. 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.
Java wins, Kotlin is second, Scala third. Kotlin is rising, while both Java and Scala have fallen for years. Groove and Clojure have stagnated for years. This link produces the chart above.
Job Ads at Indeed
The Indeed job search is active in 63 countries representing 92% 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.
Java wins by an order of magnitude, Kotlin is second, Scala third.
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:
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’s 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, then you have to use Scala on the JVM.
- Groovy is a has-been on the JVM: Kotlin stole its place of “hipper 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.