Tales from the jar side: Between Chair and Keyboard, a Groovy Podcast, IntelliJ stuff, TextBlocks in Hamcrest, and some Halloween jokes
Gag I'm looking forward to using this week: My jokes work much better in person than on Zoom, because they're not remotely funny
Welcome, jarheads, to Tales from the jar side, the Kousen IT newsletter, for the week of October 24 - 31, 2021. This week I taught an O’Reilly Learning Platform course on Mockito and the Hamcrest Matchers and did a couple of podcasts/screencasts.
If you wish to become a jarhead by actually subscribing to this (free!) newsletter, please use this button:
Screencasts
On Monday, I became the first repeat guest on my friend Nate Schutta’s Between Keyboard and Chair screencast. Here’s the YouTube recording, if you’re interested:
As Nate says in this tweet:
We talked about my book, Help Your Boss Help You, and sports, and Ted Lasso, and lots more. I gave him my favorite sports scenario, which is that Tom Brady returns to the Patriots at age 50 to win his final Super Bowl, which will be even better if it happens the year after Bill Belichick retires. That’s ridiculous, though — Bill Belichick is never going to retire.
Also this week celebrated the long-awaited return of the Groovy Podcast, this time with the legendary Paul King, current head of the Groovy project:
Here’s the YouTube video directly:
(For those who want them, here are the show notes.)
I worked hard not to make any Australia jokes during the podcast. I never said the words “down under” or “g’day mate,” and I avoided any references to Crocodile Dundee, Russell Crowe, Hugh Jackman, Nicole Kidman, the Hemsworth brothers, or even Olivia Newton-John. It was tough, but I presume Paul appreciated the effort.
Coordinating time zones was fun. Paul is based in Brisbane, Australia (GMT+10), and I’m in Marlborough, CT (GMT-4), so that’s a lot of hours between us. We recorded it at 7pm my time, which was 9am the next day in Australia. I must admit, it was great having Paul reassure me that nothing bad was going to happen overnight.
IntelliJ IDEA
Last week I mentioned that I’d ported my Grails teaching app to the new version, 5.0.0, but that my favorite IDE, IntelliJ IDEA, didn’t work correctly with it. Just before our screencast, Paul told me that the latest early access version, 2021.3 EAP, fixed that:
Sure enough, everything works now, which is awesome. As I mentioned, I might have an opportunity to help a company upgrade their existing Grails 2 app all the way to Grails 5. I really hope that happens now. :)
Speaking of IDEA, the most recent newsletter from Dan Vega (which you can read here) talks about the GitHub Copilot plugin for the IDE. The Copilot system tries to guess what code you want based on the name of a class or method you type, or a comment you add. It’s a machine learning system trained on billions of lines of public code hosted on GitHub, so if you ever contributed to a public repository there you’re now part of that system.
Copilot claims it “speaks all the languages you love,” and on the home page it lists Python, JavaScript, TypeScript, Ruby, Java, and Go, but then says it understands dozens of languages. I also have installed the plugin and done a few experiments, and I can vouch for the fact it suggests code in both Kotlin and Groovy.
See Dan’s newsletter for screenshots and details. I have to admit I’m still not sure how I feel about it. Code generators can be great if you know what you’re doing, but they can be disastrous otherwise. As I say, I installed it, so I’ll let you know.
Dan also talked about the new GitHub dev system, formally known as GitHub CodeSpaces. That lets you access a fully configured, browser-based development environment. Here it is on that same Grails app:
I tried to install a Groovy plugin and couldn’t find one, but apparently it recognized Groovy code already, as the syntax highlighting from my Grails app shows. I can’t execute anything in the browser, since I’m not a CodeSpaces subscriber (as a GitHub member I can use it without paying, but my capabilities are somewhat limited), but it’s quite promising and may work very well in presentations.
Funny that Dan and I were both exploring the same new systems the same week, but given that we both are involved in the same technologies, maybe it’s not so surprising.
Hamcrest Matchers
During my class this week on Mockito and the Hamcrest Matchers, a question came up about whether Hamcrest understands TextBlocks, the multiline strings introduced in Java 15. Since I normally teach that course using Java 11, I didn’t know.
Setting up a new project to test it, however, was quite easy. The API shows that the Matchers class has a static method called equalToCompressingWhiteSpace:
The docs show that all internal white spaces (including tabs, carriage returns, line feeds, and so on) are compressed down to a single space before the comparison is done. I decided to try that for a text block, and here’s the result:
Yup, works like a charm.
There’s one more reason I’m mentioning the Hamcrest library, which is to give you one my favorite naming stories. Why is are the Hamcrest Matchers called Hamcrest? Did they come from Downton Abbey or something similar?
Nope. Take a look: the word Hamcrest is an anagram of the word Matchers.
Lovely. I used the library for years before I knew that, and I continue to use it partly for that reason.
Halloween Is Scary
Happy Halloween! Remember, don’t overthink the candy — kids like chocolate. You can’t go wrong with Snickers, Kit Kats, Twix, Reese’s Peanut Butter Cups, M&M’s, etc.
According to candystore.com, the most popular candy in my home state of Connecticut is Almond Joy, with Milky Way in second and M&M’s in third. Sorry, no. I simply don’t believe it, despite the data they claim to have. As a compromise, I’ll just say those aren’t the most popular candies in my house, and any kids who show up will be much happier with our contributions than those.
As for costumes, I’ll stick with the Wednesday Addams line from The Addams Family movie, who, when asked why she wasn’t dressed up for Halloween, replied:
I'm a homicidal maniac. They look just like everyone else.
I saw a couple of excellent costumes on Twitter:
Clever. Here’s another good one:
This comes from a cartoonist who recently published a book:
This next one takes a bit of explanation. Here’s a tweet thread about Weierstrass’s Monster, a function that is everywhere continuous and nowhere differentiable (follow the thread — or see the Wikipedia page — for details):
That’s scary enough, but this reply was the best:
Finally, I loved this idea:
Poor Amy (I assume Amelia Earhart’s friends called her Amy, right?). Flies all over the world, and all anybody remembers is the one flight she didn’t complete.
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:
Mockito and the Hamcrest Matchers, on the O’Reilly Learning Platform
Between Chair and Keyboard screencast
Groovy Podcast recording with Paul King.
This week:
Basic Android Development, on the O’Reilly Learning Platform
Deep Dive: Spring and Spring Boot, an NFJS Virtual Workshop