How to Build Java Applications Today: June 14, 2021
Tags: java, bpf
Published: 2021-06-14 20:46:36

## 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](https://bpfnl.substack.com)! Or read it on [dev.to](https://dev.to/ksilz/series/11995),  the [Java Cafe](https://thejavacafe.com/ksilz/series/1), or [Medium](https://ksilz.medium.com). 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](http://www.quotationspage.com/quote/605.html), Roman playwright [(185 BC - 159 BC)](https://en.wikipedia.org/wiki/Terence), spoken two thousand years ago, do apply to programming: [Object-orientation](https://en.wikipedia.org/wiki/Object-oriented_programming#History) and [functional programming](https://en.wikipedia.org/wiki/Functional_programming) are both 80 years old.

***

## Stand-Up
I got my next conference talk [on Wednesday](https://betterprojectsfaster.com/learn/talks-it-tage-2021-jhipster-faster-tools-and-technologies/) 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](https://blog.frankel.ch/backpressure-reactive-systems). 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](https://techcrunch.com/2021/06/08/numerous-popular-websites-are-facing-an-outage), 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](https://bpfnl.substack.com/p/how-to-build-java-applications-today-068)). Java 17 is  [now feature-complete](https://mail.openjdk.java.net/pipermail/jdk-dev/2021-June/005690.html). 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](https://bpfnl.substack.com/p/how-to-build-java-applications-today-4b3)). 
 
So if you’re stuck on Java 8 and can handle the truth: Here are all the [features from Java 9 - 17](https://4comprehension.com/busy-developers-guide-to-java-9-10-11-12-13-and-above) that you don’t have.

[InfoQ article with Java 17 feature list](https://www.infoq.com/news/2021/06/java-news-roundup-jun07-2021/)

***

#### 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](https://bpfnl.substack.com/p/how-to-build-java-applications-today-b67)), 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](https://grails.org) having a comeback, and nobody noticed? Or is everybody writing [Gradle build scripts](https://docs.gradle.org/current/userguide/writing_build_scripts.html) 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!

[TIOBE Index](https://www.tiobe.com/tiobe-index/)

***

#### 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](https://en.wikipedia.org/wiki/X86). That’s slowly changing as companies like [Apple](https://betterprojectsfaster.com/blog/weekly-links-2020-11-23#apple-macbook-pro-with-m1-reviewhttpswwwthevergecom21570497apple-macbook-pro-2020-m1-review) or [Amazon](https://www.techradar.com/news/amazons-arm-based-cpu-embraces-extreme-fine-tuning-as-it-takes-on-intel-and-amd) use CPUs with the [ARM architecture](https://en.wikipedia.org/wiki/ARM_architecture). ARM CPUs power all our mobile phones and tablets. Java 16 supports [Windows on ARM](https://betterprojectsfaster.com/blog/release-jdk-16#openjdk-ports), Java 17 macOS on ARM (see [last week’s issue](https://bpfnl.substack.com/p/how-to-build-java-applications-today-068)).

There’s a new kid on the CPU block (diagram): [RISC-V](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/University_of_California,_Berkeley) in 2010. A number of companies are [working on RISC-V CPUs](https://en.wikipedia.org/wiki/RISC-V#Implementations), among them [Alibaba](https://www.techspot.com/news/81177-china-alibaba-making-16-core-25-ghz-risc.html). 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](https://bpfnl.substack.com/p/how-to-build-java-applications-today-068)). 

That’s where Java comes in: Alibaba ported Java to RISC-V in their [Dragonwell OpenJDK distribution](http://dragonwell-jdk.io) (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](https://youtu.be/VYB8YM-Dh8k?t=737) in the [SPECjbb benchmark](https://www.spec.org/jbb2015/). They have a couple of ideas to [make it faster](https://youtu.be/VYB8YM-Dh8k?t=991). 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](https://youtu.be/VYB8YM-Dh8k?t=1408) 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](https://devblogs.microsoft.com/java/announcing-preview-of-microsoft-build-of-openjdk/), they claimed 500 thousand deployed JVMs “excluding all Azure services and customer workloads”. Alibaba claims [1 million JVM instances](https://youtu.be/VYB8YM-Dh8k?t=155) - though this may include their Alibaba cloud service and customer workloads.

[YouTube video](https://youtu.be/VYB8YM-Dh8k)

*** 

### Frameworks & Libraries
#### Kotlin Roadmap Update
Kotlin users: Don’t despair after seeing the TIOBE index! JetBrains, as the [creator of Kotlin](https://kotlinlang.org), 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](https://bpfnl.substack.com/p/how-to-build-java-applications-today-faf)). 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](https://kotlinlang.org/docs/whatsnew1430.html#kotlin-jvm) is one of these three backends.

And because JetBrains wants Kotlin everywhere, we’ll get [another compiler backend](https://youtrack.jetbrains.com/issue/KT-46773) - for [WebAssembly](https://webassembly.org). 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](https://youtu.be/CVE4bWvuD3o?t=942) silently sheds a tear for Applets when reading this…

Kotlin will also [get better for these iPhone developers](https://youtrack.jetbrains.com/issue/KT-42301) who think mobile development is too easy: They add Kotlin on top of native iOS & Android UI code. [Kotlin Multiplatform Mobile](https://kotlinlang.org/lp/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](https://youtu.be/kQxTuZ8bUI0?t=1225)? But that’s just me…

What else? Kotlin/Native (think: [GraalVM native image](https://www.graalvm.org/reference-manual/native-image/) for Kotlin) gets a better [garbage collector](https://blog.jetbrains.com/kotlin/2021/05/kotlin-native-memory-management-update/), Apple’s M1 Macs will get [more support](https://youtrack.jetbrains.com/issue/KT-46772), and Kotlin will run [better in the JetBrains IDEs](https://youtrack.jetbrains.com/issue/KTIJ-18174). 
 
 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](https://blog.jetbrains.com/kotlin/2021/05/nine-highlights-from-the-kotlin-roadmap#sealed-whens). What I mean is: That sentence doesn’t make any sense. The dictionary defines “to focus” as “[to cause to be concentrated](https://www.merriam-webster.com/dictionary/focus)”. 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](https://www.merriam-webster.com/dictionary/scattershot)”: “broadly and often randomly inclusive”.

[Blog post](https://blog.jetbrains.com/kotlin/2021/05/nine-highlights-from-the-kotlin-roadmap)

***

### 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](https://www.java-forum-stuttgart.de/de/Home.html)”. 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](https://youtu.be/dxqA6RhEwdQ?t=3). See for yourself [on YouTube](https://youtu.be/3xNAt4Felt4)! 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](https://youtu.be/3xNAt4Felt4)? 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](https://en.wikipedia.org/wiki/Chroma_key). It was five steps for me:
1. I used a [portable green screen from Elgato](https://www.elgato.com/en/green-screen). My wife filmed me with my iPhone in front of it.
2. I then imported the video into my [video editing software Screenflow](https://www.telestream.net/screenflow/). I applied the “[Chroma Key](https://comments.telestream.net/2017/08/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!

[My talk teaser video](https://youtu.be/3xNAt4Felt4)

***

### 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](https://github.com/spring-projects/spring-boot/releases/tag/v2.5.1). Version 2.4.7 [has 36](https://github.com/spring-projects/spring-boot/releases/tag/v2.4.7), while version 2.3.12 [has 26](https://github.com/spring-projects/spring-boot/releases/tag/v2.3.12.RELEASE).

[2.5.1. announcement](https://spring.io/blog/2021/06/10/spring-boot-2-5-1-is-now-available), [2.4.7 announcement](https://spring.io/blog/2021/06/10/spring-boot-2-4-7-available-now) & [2.3.12 announcement](https://spring.io/blog/2021/06/10/spring-boot-2-3-12-release-available-now)

***

#### Spring Framework 5.3.8
The “framework behind Spring Boot” released version 5.3.8 with [35 fixes and improvements](https://github.com/spring-projects/spring-framework/releases/tag/v5.3.8). That’s the version that’s [in Spring Boot 2.5.1](https://github.com/spring-projects/spring-boot/issues/26761) (see the previous section).

[Release announcement](https://spring.io/blog/2021/06/09/spring-framework-5-3-8-available-now)

***

## 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](https://yourhomeingoodhands.co.uk/)" as CTO in 2020.

Karsten has [this newsletter](https://bpfnl.substack.com/), a [developer website](https://betterprojectsfaster.com/), and a [contractor site](https://ksilz.com/). He's on [LinkedIn](https://www.linkedin.com/in/ksilz/), [Twitter](https://twitter.com/karsilz), and [GitHub](https://github.com/ksilz). Karsten is also an [author at InfoQ](https://www.infoq.com/profile/Karsten-Silz).