Tales from the jar side: Java 16, Book excerpt, and Entertaining tweets

You say "adjusting to Daylight Savings"; I say "Nap Time"

Welcome to Tales from the jar side, the Kousen IT newsletter, for the week of March 7 - 14, 2021. This week I taught a Managing Your Manager course and a What’s New In Java course, both on the O’Reilly Learning Platform.

Both of those classes were really fun. I felt a bit sad about the Managing Your Manager course, however, only because of its timing. My upcoming book, Help Your Boss Help You, is based on that course, and the beta version of the book goes live on March 17. That’s this Wednesday, so I missed by exactly a week. I’m only sad I wasn’t able to give the attendees a link to the book website. That’s okay, though. The class went well anyway, with a lot of good questions from an active group.

In order to prepare for the beta release, my editor asked me for “three representative excerpts, each 4-6 pp long, to be available on the book’s web page.”

Here’s one of the excerpts I sent. It’s from the first chapter, entitled Making Inevitable Conflict Productive:

Managing the relationship

The difficulty comes from viewing the manager/employee relationship as a problem to be solved, rather than a long-term relationship. Working professionals are problem solvers and tend to see the world in those terms. We want to fix problems and thereby make them go away. Your relationship with your boss is not like that. By viewing the relationship as a situation to be managed rather than solved, you can try to create a balance between the two of you that evolves over time and ultimately gets both sides what they want.

The term that will be used in this book for such a relationship is constructive loyalty. Once you have a solid relationship with your manager based on constructive loyalty, you approach any potential conflicts with your manager differently.

The following list summarizes techniques that build such a relationship, which will be discussed in more detail in future chapters:

  • You and your manager meet regularly, so you can talk about what you'd like to do in the future (like learn a new language, in the example above) during one of your periodic meetings.

  • You understand how your manager communicates, so you can express your interests and concerns in a way are most likely to be heard and understood.

  • You provide the boss with arguments they can use to justify the new approach to their bosses, and will "have their back" if problems arise.

  • Your boss knows that you will find a way to build and maintain the new system, regardless of approach. They know "you got this," meaning you will take responsibility for the success of the project.

  • You and your boss build up a history of successfully dealing with conflicts. Over time, you established that if the boss says no, you will push back, but you'll go back to work anyway.

Any disagreement is therefore not a crisis. It's an opportunity to express what you want, and to encourage the manager to help find a way for you to get it, if not this time, maybe the next one, or the one after that.

I sent that, along with three other four-to-six paragraph excerpts. My editor reacted like I hadn’t sent anything, which I found annoying. Eventually we realized that when he said “4-6 pp” long, he meant pages, not paragraphs.

Oh. Never mind. Still, the excerpts I picked do work, so I thought I’d include the first one here. I may use the others in future newsletters. As they say, waste not, want not.

Java 16 Coming This Week

This week (on Tuesday, March 16, to be precise), Java 16 will be released. I talked about it in some detail during my What’s New In Java course this week. The biggest new capability will be Java records, which are simple class-like files that cause the compiler to generate lots of support structure, like a toString method, an equals method, a hashCode method, a set of accessor methods based on properties defined in the constructor, and so on. I’ve talked about them in previous newsletters, so I won’t give additional examples here.

On the other hand, it can’t hurt to show a simple example, which you can easily skip if you’re not interested. Here’s a Person record:

public record Person(Integer id, String first, String last) {}

That’s the whole thing. It has all the methods described above, along with methods called id(), first(), and last() which are used to access the corresponding properties.

From the associated PersonTest in my GitHub repo:

@Test 
@DisplayName("check equal records not the same objects")
void checkEquivalenceAndReferenceEquality() {
    Person p1 = new Person(1, "Jean-Luc", "Picard");
    Person p2 = new Person(1, "Jean-Luc", "Picard");
    assertAll(
        () -> assertEquals(p1, p2),
        () -> assertNotSame(p1, p2)
    );
}

@Test 
void checkPropertyMethods() {
    Person p = new Person(1, "Will", "Riker");
    assertAll(
        () -> assertEquals(1, p.id()),
        () -> assertEquals("Will", p.first()),
        () -> assertEquals("Riker", p.last())
    );
}

I have other examples where I add additional constructors that delegate to the first one, and add instance methods like getName that concatenate the first and last fields together, and even an inner record called Job that has its own name.

The other “general availability” (GA) feature in Java 16 is pattern matching, which basically just saves you a single line in any if statement that uses the instanceof operator. I expect that will be much more interesting in the future when they add support for the enhanced switch statement, and destructuring, and more, but right now it’s not much.

Pandemic Anniversary

Lots of articles in the newspapers and online reviewed the unofficial anniversary of the pandemic, which they designated as March 11. That’s when the NBA shut down, and Tom Hanks reported having COVID, and the following dominoes canceled basically everything “temporarily”. Temporary at the time was supposed to mean by April, or June, or maybe July 4th at the latest, but those were simpler days when the government was actively trying to kill us all.

I briefly considered adding my own retrospective, but no, I’m not ready yet. I have had one vaccine (Pfizer) so far and am scheduled for my second one in a couple weeks. I’d like to believe life will get better after that, and that’s true, but it will take time before things are back to whatever the new normal is.

Instead, I’ll just point to one very thorough, very powerful post on Medium, entitled Will We Ever Grasp the Enormity of the Pandemic? It’s long, but extremely well-written, and provides a stark reminder of how deeply divided this country remains and how many costs have already accrued that will have to be paid eventually. One line I particularly liked was when the author (Eve Fairbanks) mentioned how a doctor called this period the deux ex vaccina — the magic vaccine that makes it all better but still has resistance to overcome.

The article also pointed out how reluctant people are to say that 2020 was actually a good year for them. My entire business was already in the process of moving online before the pandemic started. The shutdown accelerated the process, and my potential market went way up as people were confined to their homes. The result is that, financially at least, last year was a banner year for me. Unfortunately, that only had a limited ability to relieve the stress, the fear, and the growing anger at the incompetent people in charge who were actively trying to hurt people. Yes, my situation could have been much, much worse, and I do feel a bit guilty about that, but I can’t deny reality. At least I was able to donate to food banks, and RIP Medical Debt, and other charities in response, not to mention voting to remove those idiots from power.

Ugh, enough about that, too. I suspect you can’t really experience PTSD until the trauma is over, and we’re not quite there yet. At least I can see the end on the horizon.

Meme Watch: Harry, Meghan, Oprah — Nope, Good Tweets Instead

I was going to talk about the Oprah interview of the royals, but the more I read about it, the more I realized I just don’t care about any of those people. I’m not going to add to the online discussions about professional celebrities, whether they were born into their roles or not. My reaction to news about any of them at this point is, yeah, whatever, never mind.

(I’m not a millennial, but sometimes I play one online.)

Instead, this actual, authentic drone footage flying through a bowling alley was awesome:

Seriously, it’s one continuous shot that ends in what appears to be a strike. Cool.

That was fun. Here are a couple more entertaining tweets from my Twitter feed this week. First, from astrophysicist Katie Mack:

Yup. In anticipation, I think we should give up DST now to get ahead of it.

Also relevant is:

Speaking of astronomical tweets, this is the anniversary of when Pluto was discovered:

This tweet is relevant to nothing at the moment, but I liked it:

Totally relevant to our current situation is:

Finally, we have this bit of marketing genius from a restaurant in Toronto:

On an unrelated note, my Google Chrome browser is now doing this:

I have no idea why it’s happening or how to fix it. The result, however, is I’ve been gradually moving over to non-Chrome browsers. Good thing I adopted 1Password recently, which makes it easy to log into my regular sites regardless of browser. For example, this newsletter was written using Firefox. But ugh, I hate when this happens.

Share Tales from the jar side

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:

  • Managing Your Manager, on the O’Reilly Learning Platform

  • What’s New In Java, same

This week:

  • Spring and Spring Boot, on the O’Reilly Learning Platform

  • Spring, private class on Thursday/Friday

  • Java 16 official release date is Tuesday, March 16

  • Help Your Boss Help You, beta version goes live March 17