Tales from the jar side: HALT, Spring, and a Groovy Podcast
As all those vendor emails keep telling me, this is a challenging time for all of us
Welcome to Tales from the jar side, the Kousen IT newsletter, for the week of April 19 - 26, 2020. This week I taught a day-long workshop called Deep Dive Into Spring, recorded a Groovy Podcast, and worked on my Managing Your Manager book.
It seemed to me that people were angrier and frustrated this week. The pandemic rages on with no end in sight, but it’s an odd thing — by sheltering at home, unless you or someone you know is directly affected by COVID-19, it all feels so far away. We see the numbers go up every day, but even that becomes a dull background noise after a while, while concerns about money and supplies are much more immediate. Evidence that the economy is crashing down around us keeps mounting, with massive unemployment and worse prospects, and that is frankly terrifying. At the moment I know way more people who have lost significant income than those who needed to be hospitalized. I’m actually surprised by that. I expected by this point everyone would know someone who was seriously ill, but it hasn’t worked out that way.
Part of the problem is time scales. When you follow social media, things happen at Internet speeds. Any news item lasts hours rather than days. It’s hard to wrap your head around being contagious for two weeks, and the real possibility that we’ll be dealing with this virus for at least another year, if not longer, seems like forever.
If no one in your immediate family is sick, it’s tempting to stop being so strict about isolation and try to get on with your life, especially when your income is in jeopardy. We all know better, but it’s hard not to be tempted to go out and do something, anything to make your life easier.
There’s an acronym used in the addiction recovery world known as HALT, which means never to let yourself become too Hungry, Angry, Lonely, or Tired. Any of those makes you much more vulnerable, and I suspect they’re danger signs for all of us sheltering in place as well. Whenever I’m feeling frustrated or overwhelmed by what is going on in the world right now, I try to keep them in mind. When people say you need to take care of yourself, I suspect this is what they mean.
Or, as I say to myself late at night when things look bleak, it’ll all look different in the morning, especially over breakfast. I always use the word different — not better — but that’s usually enough to get me through the dark times, at least so far.
Deep Dive Into Spring
This week I taught another of the new No Fluff, Just Stuff Virtual Workshops. My Deep Dive Into Spring was a full-day course held online. As it happened my group of student were pretty quiet, but they did appear to be engaged.
If you’ll permit a short technical note, I ran into a problem almost at the very end of the course that I didn’t have time to resolve then but understand now. There’s at least a chance one of those students is reading this newsletter, so let me briefly describe the problem and the solution. Feel free to skip this section if you’re not interested in that.
I was trying to show an example that used Spring Data JPA, which generates your entire data access layer for you. The process worked, but much to my surprise one of my standard tests failed and I couldn’t figure out why at the time.
What happened was that I created my own interface, called OfficerRepository, that extended the CrudRepository interface from Spring. When I retrieved all the officers, however, I was surprised to find that I was unable to turn the result into a Java stream. The reason turns out to be that in CrudRepository there is a method called findAll that returns an Iterable:
Iterable<T> findAll();
By contrast, in all my exercises, I actually extend a subinterface of CrudRepository called JpaRepository, which overrides that method to return a List:
List<T> findAll();
List extends Collection, which has the default stream() method in it. Iterable is a superinterface of Collection. So when I called findAll and expected to be able to call stream() on the result, the method wasn’t there.
There’s no real reason I extended CrudRepository rather than JpaRepository, other than I thought it might be simpler and I didn’t need all the extra methods. I spent a little time afterwards figuring out how to turn an Iterable into a Stream and hit on the StreamSupport class:
StreamSupport.stream(dao.findAll().spliterator(), false)
I wondered briefly how I was ever going to explain the bizarre spliterator method, but realized I should just go back to JpaRepository and the problem magically goes away.
At least now I know what happened, and I’ve successfully put off once again the day when I have to really figure out what the heck a spliterator is.
Groovy Podcast
This week we finally got around to doing another Groovy Podcast.
My background is, shall we say, groovy
(Note: audio-only version available on Podbean; see also the Groovy Podcast home page hosted on the NFJS web site.)
My co-host Baruch Sadogursky is in the upper left, and for some strange reason he likes to wear a tophat. Marketing, I guess. The third person is an excellent developer named Szymon Stepniak, who has a blog and a YouTube channel. Since Baruch is in California, I’m in Connecticut, and Szymon is in Poland, working out when we could record across about 10 time zones was fun. Still, a good time was had by all.
Managing Your Manager
I spent time this week on the chapter that describes the world of your manager, in terms of pressures and problems that come with the job that they don’t necessarily talk to you about. I broke them into categories like:
Illusion of control: managers set priorities and assign tasks, but they’re still dependent on others to carry them out.
Loss of status: managers promoted from technical ranks are often surprised to find that they’re not considered as valuable as before. Finding and training technical people is difficult and expensive. You can find a low-level line managers anywhere, however, though they may not be any good.
Erosion of skills: it’s hard enough as an active technical person to stay current in your field. As a manager, that becomes impossible, and anyone promoted from the technical ranks worries that they’ll never be able to go back.
Inadequate information: most managers I know are forced to make decisions without knowing everything they need to know. If a manager knows even 75% of what they need, that’s considered a luxury. That’s a stress level most technical people rarely have to face.
The point is that if you better understand what your manager is experiencing, you’re better able to understand why they do the seemingly ridiculous things they do. Since the goal is to establish a constructive loyalty relationship with your boss, understanding their situation helps.
That reminded me of a book I read recently that I really liked, called Never Split The Difference: Negotiating As If Your Life Depended On It. The book was written by a former FBI hostage negotiator, and with a title like that I expected it to be brutal.
On the contrary, I don’t think I’ve ever read a book that emphasized emotional intelligence more. Everything was about building a connection to the other party, avoiding direct confrontations wherever possible.
The whole book was fascinating, though I need to go through it again if have to negotiate my rates again any time soon. But more than that, I felt it validated my whole approach to relationship building described in my book, including how to push back when you feel you’ve been wronged.
Yak Shaving And Other Adventures
During the week I had to help my wife record a voice part for her church choir. Since everyone is sheltering at home, the director sent a few of the choir members the background instrumentals, and each person had to send back a recording of themselves singing over it, ideally without the backing music.
The process worked, but as anyone who works with computers can tell you, the process involved solving a series of problems one by one. Find the right software, set up a microphone, find headphones that worked, make sure the recording only captured voice and not the background music, figure out how to save the recording to a file that could be sent via email, and so on. As an IT person, none of the steps were all that difficult, but none of them were as straightforward as they should have been, either.
In the IT world, this is normal. We call it yak shaving, where solving each problem leads to another one, and another, and another, until you’re dealing with completely unrelated problems.
As an IT person, I’m so inured to the process I expect it, and don’t give it much thought. My wife, however, was very grateful that I helped work out a process that got her what she wanted. The biggest lesson I took from the experience is a reminder that when someone has to do yak shaving, their not actually interested in a career in grooming bovines. Chances are all they wanted was to sit on the couch and watch TV without being covered in animal hair.
For another odd term used in IT, see bikeshedding, which is the process of wasting all your project resources on unimportant details.
Last week:
Deep Dive Into Spring, an NFJS Virtual Workshop.
Recorded a Groovy Podcast.
Worked on Managing Your Manager.
This week:
Functional Java, on the O’Reilly Learning Platform.
More writing on Managing Your Manager.
Speaking of yak shaving, I have a haircut scheduled — oh wait, that’s not going to happen. Good thing I don’t have much hair left, I guess.