Tales from the jar side: Teaching Android, New Spring Boot version, Darth Elon Strikes Again, Random music thoughts, and more
You know why Teslas are so expensive? Because they charge a lot. <rimshot>
Welcome, fellow jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of November 20 - 27, 2022. This week I taught the second week of my new Android Development bootcamp on the O’Reilly Learning Platform.
Regular readers of (and listeners to) this newsletter are affectionately known as jarheads, and are far more intelligent, sophisticated, and attractive than the average newsletter reader (or listener). If you wish to become a jarhead, please subscribe using this button:
As a reminder, when this message is truncated in email, click on the title to open it in a browser tab formatted properly for both the web and mobile.
Teaching Android
This week I continued my new Android development “bootcamp,” but honestly it wasn’t that different from what I’d done before. the course was taught in Kotlin, which I liked, but of course that didn’t change the concepts. Previously, because I couldn’t assume the students knew Kotlin, I started the course in Java, showing them the concepts like Activities, Fragments, and Intents, and then re-did our applications in Kotlin. This time, because the first week was about Kotlin, I was able to skip that transition.
I’m not sure how well it worked, however. Kotlin is still very new to most of the students, so it was still a bit of a barrier to entry. Google has made it clear, however, that Kotlin is the future, and they want everybody in Android using it.
(I usually exaggerate the Android statistics from Google to make a point, like telling the students 105 out of the top 100 Android applications are implemented in Kotlin. Sometimes that gets a chuckle. If you read the Google blogs, though, you would be forgiven for thinking that was a real number.)
My biggest problem with the course, as usual, is that the apps get too complicated too quickly. I tried to use one of the Google codelabs to illustrate the ViewModel
component from Jetpack (specifically, the Android Room with a View), but I think I lost everybody in doing so, because there are too many places I have to just gloss over in the code. I have my own simplistic ViewModel
demo, with the profound name My ViewModel Demo, in this GitHub repository. It combines fragments with a ViewModel
subclass with Data Binding. I’ll go back to that this week. We also have to talk about Jetpack Compose this week, though, so that will be enough of a challenge by itself.
Spring 6 and Spring Boot 3
The big news in the world of server-side Java is that Spring Boot released version 3.0.0, which goes along with the Spring 6 release from last week.
It’s a big change, but not for many Spring-related reasons. The big shift is that this version requires Java 17 or above, and all the data I’ve seen suggests the market share of Java 17 is in the single digits at best. In addition, the enterprise libraries have all undergone the shift from the java
to the jakarta
namespace, associated with the move to Jakarta EE 10 (or, in a handful of cases, 9).
What the heck does that mean? It means that Oracle is a company dominated by lawyers. A few years ago, Oracle decided it still wanted to be in charge of the regular Java specifications, but even though they provide their own cloud solution, they don’t care about the Java Enterprise Edition specs. They therefore contacted the Eclipse foundation (an open source foundation named after, but not restricted to, the Eclipse editor) and gave the specs to them.
The Eclipse people were like, cool, and announced their own support for Java Enterprise Edition, only to be told by Oracle, you can’t call it that. I imagine (based on zero evidence, but still) that the conversation went something like:
Eclipse: Hey, thanks for the specs. They’ve been getting old, and we’ve got lots of people who want to update Java EE.
Oracle: Oh, by the way, you can use the name Java anymore.
Eclipse: Wait, what?
Oracle: Yeah. And you have to change all the package names in the specs, so they don’t start withjava
orjavax
anymore, too.
Eclipse: But, they’re your specs! You gave them to us. Changing them all now will disrupt everybody!
Oracle: Not our problem. At least not anymore. Just keep in mind our legal department is three times the size of our (and your) developer group.* Have fun!
*Probably not true, but feels it sure feels like that sometimes.
The Eclipse people therefore needed a new name, so they went with Jakarta.
Why Jakarta? As an American, my knowledge of geography is pretty exceptional, but that isn’t exactly a high bar. So where is Jakarta? It’s the capital of Indonesia:
Jakarta is on the island of Java, get it? It’s all a gag. Java on the eastern island, Sumatra across the straits, Krakatoa in the middle grows until it goes boom every few hundred years.
In August of 1883, the volcanic island of Krakatoa exploded in one of the largest, and loudest, detonations in recorded human history. Stories say the sound was heard in Madagascar, 3000 miles away across the Indian Ocean. It changed the tides in the English Channel (!) as the shock waves propagated around the world. Scientists now think the eruption was the equivalent of 200 megatons of TNT, which is about 13,000 times the size of the nuclear bomb that dropped on Hiroshima.
It eventually led to the discovery of plate tectonics, as Indonesia itself is part of the Ring of Fire, the series of volcanoes dotting the Pacific Ocean where continental plates bang into (and subduct) each other.
One more side note: Indonesia is planning to move its capital away from Jakarta, to the island of Borneo 1300 km away. As this BBC News article says,
Jakarta has become crowded, polluted and is sinking at an alarming rate due to the over-extraction of groundwater. Home to more than 10 million people, it sits on swampy land on the large island of Java. Air pollution and traffic jams in the city are notorious. Government ministers have to be escorted by police convoys to get to meetings on time.
I once had a developer from Jakarta in one of my Java courses, meaning she was a Java developer from Java. I thought that was pretty cool.
Anyway, the new release of Spring Boot will include all the associated package name changes and updated specifications.
If you’re a developer, that doesn’t sound like a terribly attractive reason to upgrade. If you look at that blog post linked above, you’ll see they’ve added one possible appealing feature, however: “support for generating native images with GraalVM, superseding the experimental Spring Native project”.
That takes a moment to explain. When Java was first created, its mantra was “write once, run everywhere,” meaning that you could develop your code on any platform (Mac, Windows, Unix, etc) and deploy it on any of the others. That mostly works, and is achieved by the classic computer science trick of adding a layer of indirection. Unlike most of the languages that preceded it, when you compile Java code you don’t create machine language instructions. Instead, you create this binary format called bytecodes, which are then translated at runtime by a Java virtual machine (JVM) into machine language for that particular platform. All you need is a JVM on each platform, and you’re good to go.
Of course, there’s a price you pay for that. Every time you run something in Java, you need to wait for the JVM to start up, and because you have to manage that as well, the memory requirements are higher.
Now, with the so-called Graal virtual machine (another Oracle product), you can use its native image tool to process compiled Java code down to the native format each machine wants. That means the start-up times and memory requirements are vastly reduced. The Micronaut people (Micronaut is a competing framework to Spring Boot, but they have provided native capabilities for a while now) have demonstrated start-up times of one of their applications using this of less than 10 milliseconds (!!), which is seriously fast.
By the way, for a normal web app or web service, my opinion is that start-up time doesn’t matter. Who cares if your app takes an extra couple of seconds to start, as long as it responds to each request quickly? That’s why most Spring-managed beans are instantiated eagerly anyway. It isn’t about how long it takes to deploy — it’s about response time after deployment. On the other hand, if you are deploying FaaS (Function as a Service) applications, then you have a simple, stateless, deployed function that shuts down between calls, such as on environments like Amazon Lambda. Since the app restarts on every call, start-up time there is everything, so the upgrade is worth it just for that.
Will that be enough for widespread adoption? I don’t know. I guess we’ll see in the next year. I rather hope it works, because I like Java 17 and look forward to using it on a regular basis, not to mention the fact I teach courses on both it and Spring. For me, it’s got the twin appeals of interesting technologies I mostly already know and job security, so it’s all good. Most companies don’t work like that, however, and it could be years before the more conservative ones decide to upgrade.
Random Topics
Let me jump around, addressing some random topics this week that probably don’t individually warrant their own newsletter.
The Continuing Saga of Darth Elon
This week Elon Musk ran another (very likely rigged) poll, and then announced an “amnesty” for all people banned from Twitter unless they violated some law. Trolls, racists, and other allies of the Shadows swarmed back onto the platform, leading to chaos if you were anything other than a cishet white male, and even for many of them.
He also fired many more developers, by email, right before Thanksgiving, because a code review suggested their work wasn’t up to standards. This apparently included the person who argued within Twitter for expanding the 140 character limit on a tweet to 280 characters, but what have you done for me lately?
Since you can’t do that to people in many countries in the EU, he’s already been sued for this, adding to his enormous and rapidly growing pile of lawsuits.
The platform somehow is still up and running, though rumor has it server failures are growing. I’ve heard experts claim that the real problems will happen when they try to roll out any new features, but I guess we’ll see.
So far I haven’t been affected (being one of those aforementioned cishet white males), and these days I still keep up both with Twitter and my feed on Mastodon (as a reminder, here’s my link over there). I’ll be sad when Twitter collapses, but until that time (or if I ever do get attacked, because who needs that aggravation?) I’ll keep checking it.
On a related note, I loved this tweet:
This is a callback to the Civil Defense episode of Star Trek: Deep Space Nine, where the Cardassians ran Terok Nor (their name for the space station) and the Bajorians were slaves in the mines. Sounds about right.
Also, this:
In case you’re wondering how to leave:
And this was the best line of all:
Speaking of Happy Thanksgiving
I have to remember this for next time
Some music notes
I spent some time this week listening to a Pandora channel of oldies hits, because I’m old. I always have to resist the urge to hit the like button when I do that, because that affects what Pandora sends me next, and if I’m not careful all my channels tend to evolve toward being indistinguishable from each other.
When I hear some of those old songs, though, I think of things now I didn’t think about then. Here are a few examples:
Elvis Presley, Suspicious Minds:
I get that “We can’t go on together with suspicious minds,” but I have to say, we’re talking about Elvis Presley here. I think it was Chris Rock who said a man is as loyal as his opportunities. If someone I knew was in a relationship with Elvis, yeah, I’d be suspicious, too.
That reminds me. When my wife and I were first dating, I remember the first time I really cracked her up. We were sitting in a restaurant, having lunch, and somehow got on the topic of collective nouns, like a pride of lions, a colony of ants, or a Court of Owls. I wanted to come up with some new ones, but the best one that occurred to me was “a hunka-hunka Elvii,” and she totally lost it.
We’ve been together ever since. I don’t think that’s unrelated.
Cliff Richards, Devil Woman:
“She’s just a devil woman, with evil on her mind
She’s just a devil woman! She’s gonna get you from behind.”
Whoa, Cliff, what happened to you? Who hurt you so badly? Over the top much?
If I sang Oh! Darling just once the way Paul McCartney did back in 1969, I’d still be hoarse today.
I finally figured out what’s going on with Brandy (You’re A Fine Girl).
I’ve mentioned Brandy before. At the time, I suggested it was time to get over that sailor. Lord he was an honest man, and his wife, his love, and his lady is the sea.
It finally occurred to me that her story is being told by some guy, with a guy’s normal blind spots. I believe now that she told people about that sailor in the same way Jan Brady had an imaginary boyfriend, just to keep those drunken slobs from the bar away her. At night, when the bar shuts down, she goes walking through the silent town, to join another barmaid in the privacy of their own home and doesn’t say anything about it because it’s nobody else’s business anyway.
But sure, guys, keep thinking she’s spending her life loving a man who’s not around.
A Thorough and Complete Review of Taylor Swift’s Midnights Album
Lol, no. One time I was watching a football game being announced by Vin Scully (of all people — he was the definitive baseball guy), and he once said a receiver was so open the nearest defender was five minutes away by phone. Similarly, when it comes to the target audience for Taylor Swift, I’d probably have to take a train, two bus transfers, and a teleporter just to be in the same zip code.
I listened to it, of course. Judging by the press, so did everybody. What shocked me later was hearing that somehow songs from the album filled the entire top ten of the Billboard Hot 100. I mean, they were pretty good and all, but I remember when Thriller scored seven number ones, and the Beatles placed multiple songs in the top ten simultaneously, to say nothing of Elvis. Taylor Swift has her gifts, but I’m sorry, she’s not Elvis, the Beatles, or even Michael Jackson.
I mentioned my surprise about filling the top ten during one of my classes, wondering how that even happened, and one of the students had an obvious explanation. The top ten includes streaming, and most people who listened to her album streamed the entire thing at once. Bingo, every song places in the top ten. Duh. It didn’t occur to me, but it’s a reminder how much the world has changed.
My impression of the album? It was … fine. The songs are pleasant enough. It’s still weird to hear her use profanity in odd places (she seems to do it for effect, to prove she’s not the Barbie doll she appears to be), but it’s a choice.
What comes through the most is that while her relationships seem to have gotten more complicated over time, it sounds like she’s still never had a happy one. I find that rather sad.
Of course, it’s hard for me not to observe that there’s one person in common in all those relationships. (If you’re a Swiftie planning to attack me for that opinion, remember that I’m old and nobody cares about my taste in music. Nor should they.)
Finally, time to admit reality (at least somewhat)
Got a lot of positive comments on that picture, from some very generous people who probably need to see their optometrists as soon as possible.
Have a great week, everybody!
As a reminder, you can see all my upcoming training courses on the O’Reilly Learning Platform here and all the upcoming NFJS Virtual Workshops here.
Last week:
Android Development Bootcamp (week 2), on the O’Reilly Learning Platform
This week:
Android Development Bootcamp (week 3), on the O’Reilly Learning Platform
Gradle, private class
Can we get a recount on the picture and being beautiful, you young whipper-snapper? Who are you calling old? I resemble that remark. Happy Thanksgiving, Pilgrim. bf