Swimming to Focus on a Problem

Yesterday, I wrote about how I use Swimming as Meditation. The extreme solitude afforded by the sensory depravation and the rhythmic repetition of strokes, kicks and breaths keep my mind in the present. Usually I try to think about nothing, but sometimes I decide to use the time to solve a problem.

I start the swimming session with a question. I will keep asking myself the question over and over. It’s similar to Natalie Goldberg’s suggestion in Writing Down the Bones to start your writing practice by repeatedly finishing the sentence “I remember…” She is using this as a prompt to keep you writing. I am using a question as a prompt to generate ideas.

One I use often is “What should I blog about today?” The last time I swam, since I am trying to learn German, I asked myself to name German words I know. The questions that work best can be repeatedly asked and answered—meaning, they prompt me to make a list. It’s hard to have a complex string of thoughts that I can remember without being able to write anything down.

Because I can’t write them down, if I have any good ideas, I have to just keep repeating them to myself until I am done swimming. I try to come up with mnemonics that will make sure I remember them. I number them and incorporate them into my stroke counting. That’s usually good enough to keep it top of mind until I can get to my phone.

It seems like it might be hard to swim and think, but actually it’s easier. If I am doing a 30 minute swim, then I will definitely think for 30 minutes. There is literally nothing else to do.

Swimming as Meditation

I don’t have a regular mediation practice, but I’ve started to think of my swimming sessions as one. When I go into the pool with this frame, it gives the meditation more purpose and the exercise extra meaning. I have intrinsic motivation to do each, and it gets combined.

Before swimming, most of my meditation has been guided by an app. I learned how to do it with Headspace, and then moved onto the Apple Watch Breathe app for lighter guidance. But, I do need some prompt to direct my thoughts. Swimming has that built-in because I need to refocus on the parts of my technique constantly.

Whenever I notice that my thoughts have drifted, I count my strokes, kicks, or breaths—or concentrate on their polyrhythmic interplay. I have a cadence of each I am trying to meet, so counting them makes it more likely that I will do it correctly. I also have a target stroke count per lap, so counting is already a part of my swimming. It incidentally keeps me in a meditative zone.

It also helps that the pool is a sensory depravation chamber. I wear non-corrective goggles and earplugs, so my vision and hearing are dulled to start, and being in the water gives me nothing to see or hear anyway. It’s the only workout I do without any distraction, and so I have been avoiding underwater headphones to keep it that way. This may be the only waking part of my day with extreme/literal solitude.

I picked up swimming again because it’s the central metaphor of my book on tech debt. This meditation frame also applies to coding. When I’m in a coding flow, I must stay present to extend it. Like swimming, the interplay of the purpose of my work and enjoyment of meditation makes me want to keep going.

Question on r/ExperiencedDevs: Getting Code Reviewed Faster

I saw this question on the ExperiencedDevs subreddit today: My colleague’s code gets reviewed no questions asked. Getting mine reviewed takes a couple of nudges. How can I improve the situation? The answers on this subreddit are usually helpful, and I saw one that I resonated with me:

Personally quick PRs, sub 15 minutes total review time, I consider to be a mini-break from whatever feature I’m working on over the span of multiple days. If your PRs are 1000s of lines long and require an entirely different headspace it may cause delays that way.

This is what I was getting at in PR Authors Have a lot of Control on PR Idle Time where I told a story about the analysis a colleague at Atlassian did on our PR data. He found that short PR’s had less idle time.

On my team, where short PRs were highly encouraged, most reviews were done in a couple of hours, with 24 hours being the absolute max. Any longer than that would often be resolved by a live 1:1 review because it meant that the code was too complex to be reviewed asynchronously.

The thread on r/ExperiencedDevs has some more advice on solutions that try to resolve the social aspects, which are helpful, but I do think PRs that are easier to review will sit for less time. If your code is inherently complex, there is still a lot you can do to make the review easy (see A Good Pull Request Convinces You That it is Correct).

Applying Program Language Learning Techniques to Learn a Foreign Language

I’m an “expert” in learning programming languages. Just counting languages that I have worked with professionally for at least 5 years, I know more than a dozen and I am 4 years into adding TypeScript to that list. But, I only speak and read one non-programming language, English, proficiently.

Learning traditional languages has not been easy for me. I learned French in school just enough to pass my statewide tests and didn’t retain enough for practical use. I tried DuoLingo for Spanish a few years ago, but felt like I got caught in a rut of naming farm animals.

But now I am planning on going to Germany for vacation this year, and I would like to know more than I do now. I know a little tourist-level German from having to travel there for work regularly in the early 2000’s. Not enough for even a simple interaction, though

Since nothing I have done has ever worked, I want to do something different this time—perhaps building on my programming language learning experience. The easy thing to see is that put serious time and energy behind learning a traditional language. I don’t have that problem with learning programming languages. I usually spend several hours a day using them when I want to learn them. Also, I have external motivation: when I got a .NET job with 0 .NET experience, I needed to learn C# fast, but I was paid to do it.

My motivation will be to have fun experiences when I am in Germany. Most of the time I will be able to use my phone to translate written text (e.g. a menu). If I need to know something quickly, it will likely be because something is being spoken to me. I might want to interact a little better with people in hotels, restaurants, and other tourist attractions (where taking out my phone would be awkward). This means more of a focus on listening exercises.

Finally, when I learn a programming language, I usually start to make something practical early into it. I can do this because I can program already, but for novices, I recommend starting with whatever canonical language book was written by the designer and to generate focused exercises that use only what you know. I’m a novice, so that’s the approach that I think I should take.

So, here’s the skeleton of my plan

  1. Allocate serious time to it.
  2. Convert some of my random YouTube and podcast consumption to German audio content.
  3. Find or generate exercises beyond DuoLingo so that I can practice remembering more vocabulary.

A Good Pull Request Convinces You That it is Correct

My onboarding peer-mentor at Trello described a good pull request as telling a story. In practice this meant that you would edit and order the commits after you were done so that the reviewer could go commit-by-commit and understand the change you made in steps.

So, for example, let’s say you were working on a feature. In your second commit, you introduce a bug, but then in your fifth commit, you find and fix that bug. Instead of just PR’ing that, you would edit the commits so that the bug was never introduced.

This is analogous to sending a document with superfluous text deleted, not crossed out. If you don’t edit the commits, you will waste the reviewers time because they might see the error in the second commit, make a comment, and then have to go back and amend their comment in the fifth. If you did this a lot, they might not even finish reviews before rejecting them (which is what I suggest you do to PRs with obvious problems).

I like the story frame, but I have started to think of a PR as more of an argument of its own correctness. I am trying to teach the reviewer the details of the problem and convince them through evidence that the new code is correct.

In a PR, I might start by introducing a unit test into the area you intend to change. Then, to make things clearer, I might commit a small refactoring (that isolates the change). It’s now possible to add more tests and possibly a failing one that shows what my intended fix will address. My small code clean-up commits are in service of that argument. Without them, it’s hard to tell if my fix won’t break something else. With them, the fix feels like a natural and inevitable conclusion.

Like a philosophical argument, I will anticipate and address the cases the reviewer might think of. But it’s not enough to handle a case in the code, your whole PR needs to make it clear that you anticipated and addressed it (with tests, comments, screenshots or any other evidence you can think of).

But the most important reviewer to convince is myself, of course, and doing the work to write the argument gives me confidence that my code is correct.

One Time I Recognized a Junior Catalyst

This is a followup to Some Behaviors of a Catalyst where I said that I didn’t think you needed seniority to be one.

More than 10 years ago, I was interviewing college seniors for an entry-level position. Among the group of very talented students there was one obvious front-runner who we offered the position to (and who accepted). But there had been another candidate that impressed us.

They interviewed well and were qualified for our position. But, we preferred candidates with some C/C++, and they had less than our preferred candidate, maybe none, I don’t remember. In any case, that was probably the deciding factor. But in a lot of other ways, they were outstanding (in the literal sense of the word). They stood out.

Here’s what I mean. A bunch of the candidates had worked together on their senior, two-semester, capstone project. We heard about this project from several angles. Over and over, a candidate would point to another person as the reason the project went well. They would, of course, talk about their own contributions, but they would also specifically point out what this other person had done as well. The thing was, the other person was always the same person, the “outstanding” one.

Even with this clue, we didn’t hire them.

About a week after we had made our decision and the offer, my boss called me in. He said a friend of his (another tech business owner) had sent in an unsolicited recommendation for a student he knew. I think he had them as intern or something. In any case, the recommendation was effusive. The student was, of course, that same one who had been recognized by their peers.

At this point we felt as if we’d be idiots not to hire them, but we didn’t have a position. The good thing about junior developers, though, is that they are cheap and you should always have a position if you see a good one. So, we created a position and made an offer. I think this is the only time I recognized a junior catalyst before working with them—the key is that people like working with them and attribute success to them. When that fact comes to light without seeking it, it’s a good sign.

Some Behaviors of a Catalyst

Yesterday I wrote that you should recognize catalysts, but didn’t say how. The problem is that so much of what they do is under the radar, but one tell is that they always seem to be part of successful teams and everyone on the team knows that they were an important member.

Catalysts can be technically great, but perhaps not the most technical person on the team or the best specialist on your corner of the company. In my experience, they are more likely generalists. They likely know the most about the other teams in your organization, which is why they can get things done with them. They often know who to go to, and those people often know them.

It’s not just the other teams, they also know the most about the architecture of other services. They might even have commits in repos they don’t own and in the third-party dependencies they use. When they need to get things done, they don’t limit themselves to just their own codebases.

Their colleagues like them and like to work with them. And the catalyst genuinely liked working with those people too (and they like people in general). They are often your best source of candidates. The best way to hire a catalyst is through a referral from someone on your team that raves about working with them.

Knowing what I know now, if I were to look for them I’d be looking for what Atlassian called “Feature Leads”, which were engineers that led a “feature” project. They often needed to orchestrate the work of several other people and perhaps several other teams. I guess to make sure they were good at it, I’d be looking for people that did it repeatedly at the same place. This work doesn’t rely heavily on their commits, but I’d be interested in people that had commits in disparate parts of the feature, not because of the technical skill it requires to do that, but because it would indicate a holistic view and might indicate a tendency to clear roadblocks, both of which are catalyst behaviors.

As I said in How Senior Software Developers Think, the more senior you are, the more you think of how your work relates to the mission of the company. Catalysts at any level do that. It’s often easier to have success as a catalyst the more senior you are, but I don’t see this as a requirement. Feature leads at Atlassian could be just past the junior level (pre-Staff/Senior level). It was a good indication that they should be promoted, but they didn’t need to have that level to catalyze.

Recognize the Catalysts

I tried to pattern my career after An Unnamed Programmer in Peopleware, whose contributions weren’t always clear, but “had never worked on a project that had been anything other than a huge success.” She was overlooked by her management, so I learned that to do this, you needed to make your contributions clear.

As a manager, I didn’t always know how to hire for this quality, but I knew it when I saw it and made sure they were on the projects that mattered. And I keep track of them, too. I might not know if a new candidate is one, but once you know someone is a catalyst, you can always hire them at your next gig.

A Little More at the End

I recently added 10 minutes to the end of most of my workouts. This lets me get the effect of another workout without having the overhead. In 10 minutes, you can burn close to 100 calories, and in a week, that would be 500. I can’t think of an easier way to do that, but that’s only because I already have these workouts on my schedule.

The same thing could be applied to other things, but probably it’s not as quantifiable. I could code for 10 more minutes after I’m done coding, but when I’m done, I’m usually spent. The same goes for writing. This makes me think my workouts aren’t taxing enough. Maybe the 10 extra minutes will change that.

Progress Bars, not Time Blocks

In Deep Work [affiliate link] (and his other works), Cal Newport has been a proponent of time blocking. He even sells a planner based on his method, which is probably the best place to learn about it. In short, he gives each hour of his day a specific task. In the happy case, this works well, but it breaks down when you get interrupted, get blocked, want to extend your time, or lose energy. He does address all of that, but that’s where I have found his method to break down for me.

Instead, I’ve been doing something my friend Joel Mazza taught me, which is based on the idea of a guiderail made up of 30 minute time blocks. Like Newport’s time blocks, there are things in your day that need to happen at a specific time, usually meetings, so those go on the guiderail in the appropriate place. After that, the system diverges in that we will build up our daily tasks and assign them an amount of time, but not a specific time on the guiderail. We just need to make sure we have a reasonable amount of work that fit in our day (and make sure to have some buffer).

Instead of letting the clock decide what we will do each half hour, we can pick based on our energy (or at least, that’s what I do). I had a half-hour before lunch, and so I am writing this post. When lunch is done, I have a lot of meetings in the afternoon, so I am doing it now, so I can be free after. Earlier today, I tackled some book editing, and I have a 12:30 accountability meeting to get back to it, so that’s why I felt free to switch.

There’s a lot more to it, but the key ideas are progress and flexibility.