How to Build Java Applications Today: June 14, 2021

TL;DR

Java 17 feature-complete, TIOBE Index June, Java on RISC-V, Kotlin roadmap update, how to make a video with animations, Spring Boot 2.5.1, 2.4.7 & 2.3.12, and Spring Framework 5.3.8.

README

This is issue 40 of my weekly newsletter, “How To Build Java Applications Today”. I read all the Java newsletters, so you don’t have to. It’s “Java news with a smile”!

If you like my newsletter, then subscribe to it on Substack! Or read it on dev.to, the Java Cafe, or Medium. Even better: Share it with people who may be interested.

Quote of the Week

‌Nothing is said that has not been said before.
The wise words of Terence, Roman playwright (185 BC - 159 BC), spoken two thousand years ago, do apply to programming: Object-orientation and functional programming are both 80 years old.

Stand-Up

I got my next conference talk on Wednesday and still have to work on the slides and the demo. Well, nothing’s going to stop me from writing this newsletter tonight. And tomorrow is another day! 😅

Code Review

Issue 39 from June 7, 2021

Why Do We Need Project Loom?

Reactive programming maximizes the amount of concurrent Java threads we can run. Project Loom reinvents Java threads because it also wants to maximize that number, but “debugging a reactive program is so much harder”. What I forgot to mention in that article was that reactive programming gives us more than just “many threads”. For instance, backpressure is a way for the data consumer to tell the data producer to send fewer data. This isn’t a feature for everybody, but it’s a reason to prefer reactive programming over Project Loom.

Prosus Buys Stack Overflow

I wrote “let’s hope that Stack Overflow will continue to serve us well” last Monday. On Tuesday morning, my browser threw “Fastly error: unknown domain: stackoverflow.com” at me when I went to Stack Overflow. What the heck?! When GitHub also was broken, I suspected something bigger was afoot here.

And I was right: A whole lot of sites were also down, including Spotify, PayPal, CNN, and the New York Times. All because of Fastly, a CDN provider. Most sites were up again after an hour and a half, including Stack Overflow. Happy copy & paste!

Bookmarks

Java

Java 17 Feature-Complete

Last week, we looked at “What’s new in Java 17?” (see issue 39). Java 17 is now feature-complete. Did anything change compared to last week? No.

So come September 14, Java 17 will replace Java 11 as “The Java version that we can hopefully upgrade to, soo, or at some time, maybe next year or so?”. After all, JRebel reported in March that 69% of us still use Java 8 - and 15% supposedly Java 7 or older (see section “JRebel 2021 Java Technology Report” in issue 27).

So if you’re stuck on Java 8 and can handle the truth: Here are all the features from Java 9 - 17 that you don’t have.

TIOBE Index June: Python overtakes Java for #2

The TIOBE Index is the much-disputed but influential, monthly programming language ranking. When we looked at the April numbers (see section “TIOBE Index April 2021” in issue 30), Java was about to lose its #2 spot to Python. It did in May and didn’t get it back in June. 😩 Python may even wrestle the #1 spot from C soon!

The good news: As #3 with 11.54% (-4.56% year-over-year), Java is safe from #4 for now. That’s C++ with 7.36% (+1.41%).

Why do we care about the TIOBE index? We care because other people do, like our bosses. Even they hear about the TIOBE index from time to time. And we don’t want to get a “Why don’t you write your next microservice in Python instead of Java? I hear it’s quite popular these days!” from them.

Looking at this month’s rankings also shows the limits of TIOBE. So Swift, the language for all Apple devices, fell from #11 a year ago to #16 this June and has 1.10% (-0.35%). Fair enough. But at the same time, Groovy shot from #31 to #12 and has 1.29% (+0.87%). Groovy? Really? Who’s using it? Is Grails having a comeback, and nobody noticed? Or is everybody writing Gradle build scripts now with Groovy instead of Kotlin?!

Talking about Kotlin: The official language of Android is #34 with 0.37%. Again: Groovy is 3.5 times as popular as Kotlin. GROOVY!

Java on RISC-V: The New Kid on the CPU Block

Most computers that run Java use a CPU from Intel or AMD with the x86 architecture. That’s slowly changing as companies like Apple or Amazon use CPUs with the ARM architecture. ARM CPUs power all our mobile phones and tablets. Java 16 supports Windows on ARM, Java 17 macOS on ARM (see last week’s issue).

There’s a new kid on the CPU block (diagram): RISC-V is an open-source architecture. So anybody can build a RISC-V CPU without paying Intel or ARM a license fee. It’s the “Linux of CPU architectures”!

RISC-V started as a research project at the University of California in Berkeley in 2010. A number of companies are working on RISC-V CPUs, among them Alibaba. That’s the Chinese “combination of Amazon, eBay, and PayPal” that I just wrote about last week (see section “Alibaba Forks PostgreSQL” in last week’s issue).

That’s where Java comes in: Alibaba ported Java to RISC-V in their Dragonwell OpenJDK distribution (and yes, that website is not secure). How does it fare against ARM, its closest competitor? It currently has only 40% of ARM’s performance in the SPECjbb benchmark. They have a couple of ideas to make it faster. But Java on ARM isn’t standing still, either, with Apple, Amazon, and Microsoft optimizing it.

So what’s the future for Java on RISC-V?

Alibaba will first release Dragonwell for RISC-V before they contribute their port to the OpenJDK itself. So we could see RISC-V in other OpenJDK distributions in the future.

Here’s an interesting tidbit: When Microsoft announced their own JDK, they claimed 500 thousand deployed JVMs “excluding all Azure services and customer workloads”. Alibaba claims 1 million JVM instances - though this may include their Alibaba cloud service and customer workloads.

Frameworks & Libraries

Kotlin Roadmap Update

Kotlin users: Don’t despair after seeing the TIOBE index! JetBrains, as the creator of Kotlin, doesn’t either. Five weeks ago, I reported on the release of Kotlin 1.5 (see the section of the same name in issue 35). Now JetBrains gives an update on what’s next for Kotlin.

JetBrains confused the heck out of me with the “common backend infrastructure” for the Kotlin compiler in 1.5: There are three different compiler backends! Now they’re working on a new compiler frontend. I think it’s going to be multiple ones because it only supports the JVM initially - and Kotlin/JVM is one of these three backends.

And because JetBrains wants Kotlin everywhere, we’ll get another compiler backend - for WebAssembly. That’s a “binary instruction format for a stack-based virtual machine”, running inside all major browsers. Is it just me, or does this sound awfully similar to “Java byte code + JVM”? Somebody at Oracle silently sheds a tear for Applets when reading this…

Kotlin will also get better for these iPhone developers who think mobile development is too easy: They add Kotlin on top of native iOS & Android UI code. Kotlin Multiplatform Mobile, in other words. Now I’d rather remove one tech stack from mobile development than add one. You know, like Google’s Flutter or Facebook’s React Native? But that’s just me…

What else? Kotlin/Native (think: GraalVM native image for Kotlin) gets a better garbage collector, Apple’s M1 Macs will get more support, and Kotlin will run better in the JetBrains IDEs.

One more thing: Dear JetBrains, you can’t write, “Check out our public roadmap to get a full picture of the 48 features that we’re focusing on right now!” (highlights are mine). Well, obviously, you can because you did. What I mean is: That sentence doesn’t make any sense. The dictionary defines “to focus” as “to cause to be concentrated”. You can’t concentrate on developing 48 features for Kotlin at the same time. That’s like saying, “I’m focusing on reading these 48 books right now”. I think the word you’re looking for is “scattershot”: “broadly and often randomly inclusive”.

Tools

How to Make a Video With Animations

A video is an excellent way to boost our presentations. But how can we make it more enjoyable? Let me tell you what I just did for a conference talk.

I recently submitted a talk to the “Java Forum Stuttgart”. This year, I could add a one-minute teaser video alongside my pitch. So I created one that doesn’t look as boring as the “talking head videos” I did in the past. See for yourself on YouTube! It’s just one minute. Sure, it’s in German. But it’s about what’s in the video. And I added English subtitles.

Did you see it? It’s really just one minute!

Ok, so my main accomplishment is having the animations and myself mixed together. How did I do this?

Like in the movies - with a green screen. It was five steps for me:

  1. I used a portable green screen from Elgato. My wife filmed me with my iPhone in front of it.
  2. I then imported the video into my video editing software Screenflow. I applied the “Chroma Key” video filter there. That replaced the green background with a transparent one.
  3. In Apple Keynote, I created the animations as a self-running slide show. I exported them as a video. Powerpoint can do the same.
  4. I imported this animation video into Screenflow and placed it behind the video of myself talking.
  5. Finally, I spent a couple of hours fine-tuning the animations to sync with my words and the video cuts.

One more trick: I shot my video in 4k resolution (3,840x2,160 pixels, at 30 frames per second). But I only exported it as HD resolution (1,920x1,080 pixels). This way, I could zoom into the video without getting a blurry result. That’s how I made the various zoom cuts in the video. No need to move the iPhone or zoom in while filming!

Releases

Spring Boot 2.5.1, 2.4.7 & 2.3.12

Last week brought a fresh round of Spring Boot maintenance updates. The latest production release 2.5.1 has 70 bug fixes, documentation improvements, and dependency upgrades. Version 2.4.7 has 36, while version 2.3.12 has 26.

Spring Framework 5.3.8

The “framework behind Spring Boot” released version 5.3.8 with 35 fixes and improvements. That’s the version that’s in Spring Boot 2.5.1 (see the previous section).

About

Karsten Silz is the author of this newsletter. He is a full-stack web & mobile developer with 22 years of Java experience, author, speaker, and entrepreneur. Karsten got a Master's degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten co-founded a software product start-up in the US in 2004. He led product development for 13 years and left after the company was sold successfully. He co-founded the UK SaaS start-up "Your Home in Good Hands" as CTO in 2020.

Karsten has this newsletter, a developer website, and a contractor site. He's on LinkedInTwitter, and GitHub. Karsten is also an author at InfoQ.

13