Tales from the jar side: Reactive Spring, Kotlin, and Coronavirus Jokes
Welcome to Tales from the jar side, the Kousen IT newsletter, for the week of Mar 1 - 8, 2020. This week I taught online courses on Reactive Spring and Kotlin with Spring, wrote a blog post about mock objects that used the Mockito framework, and recorded a very short YouTube video called “Astronauts in Kotlin” just to see what that’s like.
I have to mention, though, that I (re)discovered that one of my friends is a very kind person. How do I know? Each week she reads my newsletter (!), and when I say something idiotic like, “I have no idea what I’m going to write about next week. I’m not sure I’ll have anything to say,” she somehow manages not to laugh in my face.
I think you’ll agree that shows remarkable restraint. Don’t get me wrong — that’s not a requirement to be my friend. I have other friends who live for straight lines like that and would give me a hard time about them for days if not weeks. (Heck, my wife is probably laughing at it right now.) But this particular friend defaults to being kind, so at least I have that going for me. Which is nice.
Reactively Springing Into Kotlin
This week I taught my Reactive Spring class, which is always a challenge partly because asynchronous coding is weird and partly because a four-hour online class is not enough time to really understand reactive streams and Spring. I've taught it enough times that I can now fit the materials into the available hours, but it's a tough class for a lot of people. It took me a lot of time and effort to make sense of that material when I first dug into it, so I sympathize. I tell the students that, but it's one of those courses where I know they'll have to spend a lot of time on their own later if they want to actually use it.
I do have one asynchronous joke, however:
The bartender says, “We don't serve time travelers here.”
A time traveler walks into a bar.
My new class this week was Kotlin with Spring. The Spring framework plays nicely with the Kotlin programming language, and I'm hoping to get a lot of mileage out of that relationship. As I’ve mentioned in previous newsletters, Kotlin is the definitive language for Android development, but if it's going to catch on on the server side as well, Spring will likely be the reason. Since I have a background in both, it’s a natural combination for me.
The course took a lot of prep, mostly because I needed to redo all my demo apps in Kotlin and that took time. I was glad to do it. The hardest part was probably guessing the background of the students and dealing with the results. I decided to assume they had some exposure to Spring but very little on Kotlin, and that seemed to work. Still, that's a lot of material to get through in one class. My plan is to see if I can offer it as a regular three-day training course onsite and see if that sells. We'll see. Success will partly depends on how much Kotlin continues to grow and partly on whether there still are any onsite classes over the next few months due to coronavirus concerns.
I Tube, YouTube, We All Tube
A lot of people who do what I do are publishing videos on YouTube these days (see, for example, the channel for my friend Dan Vega). You can find many, many training videos online. Since I now have an updated copy of the ScreenFlow tool, I thought I’d try my hand at making a short (under 5 minute) video to see what the process is like. I’m not great at editing video, but I had a simple demo in mind, so I figured why not?
The result is this video, called Astronauts in Kotlin:
In my demo, I download data from a free web service in JavaScript Object Notation (JSON) form using the readText Kotlin extension function on java.net.URL, parse it using Google’s Gson library, and test the results using JUnit 5. Let me know what you think.
Of course, the biggest thing I learned was something I already suspected — making a decent video is a lot of work. I don’t know how often I will do this, but it was fun to try it once.
Now that it’s published, I’ll admit that I really wanted to refer to Pigs In Space, but I couldn’t figure out a decent segue to it.
Mocks Aren’t Stubs, Or Nice, Either
Another little “side job” I decided to attempt this week was to write another blog post. Last weekend at the NFJS event in Madison, WI, I gave a presentation on JUnit and the mocking framework Mockito. Once of the challenges with Mockito is that a lot of developers don’t quite get the concept of mock objects and what they’re used for. The Mockito site doesn’t help much, because while it does an excellent job of explaining how to make Mockito do what you want, it’s a bit thin on explaining why you want to use it in the first place.
I therefore published a blog post called Why Use Mocks?, which goes through a simple publisher/subscriber system.
The post describes a simple example I’ve been using for years, which I learned from the Spock testing framework.
Of course, I can’t use mocks without thinking about this:
That’s way harsh, Nelson
Speaking of coronavirus jokes
I’ve only seen two coronavirus jokes that were actually funny. Here’s the first one:
I can see how that might be a problem
There’s a joke in there somewhere related to, “your mouth is writing checks your body can't cash”, but I can’t quite find it.
The other was from, of all people, Weird Al Yankovic:
Seems like a missed opportunity, but be sure to wash your hands afterwards
The replies were all like, “that would be sick”, and “you know it would go viral”, and I think we can all agree that both are true.
Incidentally, if you’ve heard that rumor that “38% of Americans won’t buy Corona beer” because of the virus, that turns out to be false. Sales are down in China, but they’re up in the U.S., so the overall effect is still not clear.
That reminds me of this classic tweet:
That one is also not quite true, or at least not as simplistic as it sounds. It’s still funny, though.
How has the virus has affected me so far? First, the dev.next conference, run by my friend Venkat Subramaniam (and which I always referred to as VenKon), was cancelled or at least significantly delayed. I was really looking forward to speaking there, and had assured Venkat that even if it was just the two of us, I’d be attending. I suppose cancellation was inevitable, however.
Also, on March 19 I was scheduled to speak at the New York Java user’s group, known as the NY Java SIG. That too was cancelled, though we’re going to try to find some way to hold the presentation online. We’ll see. If that happens, I’ll mention it here and on Twitter (where my handle is @kenkousen, in case you didn’t know).
I should also mention that a friend told me that she probably had the virus itself. She was so sick for three days that she actually went to the emergency room. They tested her for flu (negative) and sent her home, probably because the testing situation in this country is still a disaster. She “self isolated”, as she put it, and recovered, but yikes.
I’d mention her name, but I saw her most recently at the DevNexus conference along with approximately 2500 other attendees, so maybe that wouldn’t be prudent.
I’m still waiting to hear about my scheduled trip to India in April for the GIDS conference (Great International Developer Summit), but nothing yet. I'm guessing the odds of it running are approximately 1000 - 1 against, but we’ll see.
I guess my biggest fear at the moment is that I’ll get caught up in a quarantine far from home. I’m in the Chicago area until Wednesday morning, so if next week’s newsletter comes from the Central (Daylight) Time zone, you’ll know something went horribly wrong.
Now more than ever I’m glad that the bulk of my work these days is online.
Last but not least
I had lunch at a local restaurant this week. Here’s a portion of the receipt (warning: nerd joke ahead):
Despite the 404 on the server, she was definitely found.
Last week:
Reactive Spring online at Safari
Kotlin and Spring online at Safari
New post Why Use Mocks? on my blog
New YouTube video, Astronauts in Kotlin
This week:
Introduction to Gradle, private class in the Chicago area
JUnit 5 course, online at Safari
Lots of writing on Managing Your Manager