Agile programming with ADHD

July 9, 2021 • Reading time: 10 minutes

I am a superhero.

Let's get that out of the way right off the bat. I am a superhero who can shoot laser beams out of his eyes. Pretty cool, huh? Only problem is, it only happens when I sneeze. And it always happens when I sneeze.

This is what ADHD is like. It's taken me a long time to figure out that shooting laser beams out of my eyes has its practical benefits, and it's taken me even longer to find some admittedly unreliable ways to control it: making the laser beams happen when I want them (let's call that "sneezing powder"), and making my superpowers go away on the occasions when I don't want to light whatever I'm looking at on fire (let's call that "clothespins on the nose").

Okay, but really. What superpowers do I have?

Hyperfocus

Attention Deficit and Hyperactivity Disorder is poorly named. As anyone with ADHD will tell you, it's not that we lack attention, we just lack control over that attention. If anything, we have a surplus of attention. Attention surplus is a state called "hyperfocus". I can focus on a task for hours on end, completely losing track of time and to the exclusion of all else: food, sleep, you name it.

Obviously, this can have detrimental effects and needs to be used in moderation, but some of my best work is done in this state.

Sneezing powder

How do I trigger hyperfocus on something that I want to get done? The state itself happens on its own, whether I want it to or not. I've been living in this brain long enough to have some sense of what things currently on my mind will lead me down that road, and often those things are not what I actually should be doing at the moment.

My most effective approach is to find something adjacent to the thing I want to get done and hyperfocus on that instead. Then, as I'm starting to make progress, I bait-and-switch my brain into transferring its attention to the correct task instead.

My whiteboard is a handy tool for this. I write the task I'm trying to accomplish on the whiteboard, along with a basic outline of what I already know about it. That way, when my gaze starts wandering, it'll land on the whiteboard and refocus me back on the thing I'm trying to accomplish.

Things I can hyperfocus on tend to satisfy a few basic criteria. Notice that the big picture "the thing is objectively important" or even "I am invested in the outcome" are not among them.

As a programmer, refactoring is a low-hanging fruit here. I usually have a clear idea of what I'd like to change and how it should work after I'm done (exactly the same as before). Knowing what to change, I know how. And there are always a few tidbits and discoveries along the way to keep the process interesting.

Consequently, if I want to get some work done, I'll start by getting my workspace clean - a few quick and easy cleanup tasks, things I know how to do and have been meaning to get to. Hey, nice progress! Oh, I just thought of how to start the problem, I'll knock that off and then get back to my cleanup.

I usually jump back and forth between cleanup and productive work a few times, which is why it's important to use git effectively to support that sort of fractured workflow. Ultimately, before I post a pull request (even to my own projects), I'll do a sanity check of my commits and cherry-pick out anything that doesn't fit. I want to keep the signal-to-noise ratio of my pull requests reasonable, and occasionally lump the miscellaneous cleanups into non-functional pull requests later on - or never merge them at all. If I got my actual work done, the cleanup did its job, whether or not the associated code changes ever get merged.

Clothespins on the nose

Yikes. Hyperfocus is why I sometimes spend hours tossing and turning while my brain chews on a problem. And it's why I'm writing this blog post at midnight after it occurred to me while I was brushing my teeth.

How do I fight it? Well, I don't. Not directly, anyway. I just sat down to write a first draft. Just to get it out of my head and onto the page, and release some of that pressure, rather than spending hours writing and rewriting it in my brain. No editing, just a single pass. And sure enough, it worked - 20 minutes of writing and I was able to drop right off to sleep. I did give myself a 30-minute time window with my Time Timer, but it turns out that even that was more than I needed.

Generally, if I have the luxury of time, I'll set aside a chunk of time to hyperfocus when I feel myself getting into the zone. If there are other things I want to accomplish and my hyperfocus subject isn't that important, I'll use my Time Timer to set a firm end time for my task. Experience has taught me that once I've made some meaningful progress on a difficult task, it'll be easier to start again later, so I don't mind breaking my focus early.

Free association

The thing that puts the "deficit" in ADHD is the number of things that jump through my brain in rapid succession. This also makes me an occasionally dizzying conversationalist, and not always in a good way.

However, it can be great for finding creative solutions to problems. Moreover, those solutions often arrive when I'm thinking about completely unrelated things.

Sneezing powder

If I'm trying to zero in on a particular solution or problem, I'll write out a stream-of-consciousness conversation, interspersing questions with answers, starting with things I already know or solutions I've already tried and found inadequate. Once that's done, I'll start posing harder and harder questions to myself.

If my brain isn't on board, I'll add the problem or question to a list on my whiteboard to keep it fresh it my mind. Then I'll go off and do something else. Sometimes this is as banal and unproductive as setting a 30- or 60-minute time box (again with my Time Timer) to play games and let my back brain continue chewing on a problem.

If not, no pressure. I'll leave it on the whiteboard and my brain will supply a solution when it's good and ready. Or I'll go and talk the problem through with my wife or my crocheted octopus, both of whom often have valuable insight to offer.

Olivia the Octopus

Clothespins on the nose

The really great ideas arrive at entirely inopportune times, such as during hyperfocus (or sleep). My solution is to have a ready-made place to file such thoughts so that I can return to what I was doing. In the case of programming projects, this means using GitHub issues and kanban boards on projects that only I will ever see. I have a variety of other places, from my whiteboard to pages on my reMarkable, where I file away various categories of ideas.

My broadest idea list is a huge and ever-growing collection of projects that I'd like to tackle "some day". As with most of my idea lists, it's large enough that I know that there's no way I'll be able to cross off everything on the list. That certainty removes the usual crushing pressure I associate with to-do lists.

ADHD is agile (and agile is ADHD)

Like most (ex-)professional programmers these days, I've spent years immersed in agile methodologies. Unlike for some of my colleagues, agile felt perfectly natural for me from day one, although the endless meetings never felt natural.

Without going into too much depth, because I'm already pushing my target blog post length, here are a few ways that I make agile methodologies work for me in my next life as an unprofessional programmer.

I don't have it all together

I don't mean to present these observations as gospel because everyone with ADHD is different, and half of the time my brain tricks don't even work for me.

But I've been a professional programmer for 10 years and a human for a while longer, and I intend to continue being both of those things for many years to come. Well, I've recently promoted myself to unprofessional programmer, which I suppose is the point of this whole exercise, but I have no intention of changing that.

If I were a student, I could request special accommodations on account of my ADHD to partially adapt my work environment to suit my brain. As an employee, the nature of that adaption is more on me to determine and if necessary negotiate, but I certainly would have limited but not infinite latitude. But I'm now a solo programmer, and I define my own hours and projects and milestones. Ultimate freedom should lead to ultimate productive potential, right? Right?

I'm still working on that bit. As always, watch my blog for further developments.