Programming With ADHD: The Good, the Bad and the Hyperfocus
Writing code is a skill that you won’t ever regret having. At least, that was my thinking when I declared a major in computer science during college.
Looking back, the decision might have been influenced by my ADHD symptoms as well. As an area of study, a job, or a hobby, programming can fit uniquely well with how the ADHD brain works. Anecdotally, other ADHDers I’ve met who write code seem to feel the same way.
But computer programming can be frustrating, too. And having ADHD can be frustrating. Put the two things together, and you have the potential for double the frustration.
In other words, there are both positives and negatives to programming when you have ADHD. That’s why I want to look at the contrasting sides of coding with ADHD: the good, the bad – and, of course, the hyperfocus!
When you see lists of good jobs for ADHD, software developer doesn’t seem to come up much, but I’ll suggest that programming can actually be a nice fit to the way the ADHD brain functions. Some reasons I say that:
- It’s hands-on: Programming is a hands-on activity where you learn by making things and experimenting. Part of what drew me to studying computer science in college was how project-based it was: more of my time was spent writing programs, less of it passively memorizing information and zoning out in lectures. People with ADHD often learn by doing and focus best when they’re actively working on something. The hands-on nature of programming allows both of those things to happen.
- You get concrete feedback: When you’re writing code, you’re trying to get that code to do something specific. As you work, you get concrete feedback on how it’s going: the code accomplishes what you want it to, or it doesn’t. In other words, you have a tangible goal you’re working toward, and you get ongoing feedback on your progress toward that goal. That concrete feedback provides a reward that can help keep the ADHD brain engaged and motivated.
- Coding is creative: ADHDers’ affinity for creative activities is well-known, but what might be less obvious is that programming has many of the characteristics that people with ADHD like about activities more traditionally considered creative. First, when you’re programming, you’re literally creating something. That ties in with programming being hands-on and providing concrete feedback. Second, there are multiple ways to solve problems in programming, and you sometimes have to think outside the box to find the best solution. The result is that ADHDers who enjoy creating things might also enjoy creating computer programs.
- There’s room for autonomy: Something that ADHD-friendly activities tend to have in common is that they offer flexibility to organize your work habits in the way you want. For ADHDers, who tend to focus much better under some conditions than others, such autonomy can make all the difference. When it comes to programming, all that’s important is that you end up with code that does what you want, so there’s plenty of flexibility to work according to your own process. You can write a program in multiple small bursts or one long marathon. You can program at any time of day, in any place. You can seek out more collaborative or individual projects. You can complete a programming project in whatever order makes sense, and you can listen to music or drink coffee while you do it. Ultimately, you can code in whatever manner fits with your brain.
I’ve just offered up a fistful of reasons why people with ADHD might enjoy programming, but that’s not to say nothing can ever go wrong when you combine ADHD and code. Enter the bad part of programming with ADHD:
- Attention to detail matters: When you’re programming, one small mistake can undermine hundreds of lines of perfectly good code. That mistake could be a typo, using the wrong name for something, a minor oversight in your logic, or forgetting about an unusual type of input your program might get (an “edge case”). If you’re programming with ADHD, chances are you will regularly make inattentive mistakes and then have to go back through your code to pick them out – a process that can be time consuming, but might become faster as you develop the skill of hunting down your own mistakes.
- Not finishing projects is a danger: People with ADHD are notorious for starting but not finishing projects. When writing computer programs, there’s so much potential for dropping projects before they’re complete. Especially with more complex programs, seeing a project through requires a significant amount of planning, then writing out the actual code to turn your idea into reality. Even after writing the code, hours of frustration might be ahead looking back through your code to figure out why it’s not doing what you thought it would. Every step of the process is an opportunity for the classic ADHD symptom of letting a project fall by the wayside while it’s still in progress.
If writing a program is a time-consuming endeavor that can be undermined by inattention to detail and a tendency to drop projects, how does a coder with ADHD get that program to the finish line? In many cases, the answer is hyperfocus.
Hyperfocus refers to a state of laser-like concentration in which distractions and even a sense of passing time seem to fade away. This state appears to be especially common among ADHDers. People with ADHD are less able to regulate their attention, which often means they have trouble engaging with a task, but sometimes means the opposite happens – they get “stuck” or hyperfocused on a task and can’t disengage.
Hyperfocus appears to occur in particular with tasks that provide an ongoing sense of reward and stimulation. Programming can meet those criteria because it’s a hands-on activity where you’re getting constant feedback and working toward a tangible goal.
I’ve talked before about how people with ADHD frequently enjoy solving puzzles and playing games. Coding is like those activities, but the goal you’re working toward isn’t winning the game or finding a solution to the puzzle – it’s building a program that works the way you want it to.
The hands-on nature of coding is key here. The flow of constantly adding progress toward your goal and getting tangible feedback helps create a sense of ongoing engagement that sets the stage for hyperfocus. And ultimately, you reach the final reward: the moment when your code does what you intended.
Hyperfocus can overcome the negatives of programming with ADHD. It can keep you glued to your computer while you go back and find your inattentive mistakes, and it can get you through pitfalls that might otherwise lead to dropping an unfinished project.
Of course, hyperfocus is fickle. When you have ADHD, it’s hard to regulate your attention, and you certainly can’t count on a state of intense focus arising you need it. Still, you might find that hyperfocus shows up enough to help the good side of programming with ADHD outweigh the bad.
“Attention to detail matters”
I’m not saying that attention to detail isn’t a thing, but as a programmer with ADHD I find that I can out-source some of that work to the computer itself. I write software, I write tests, the tests catch my trivial mistakes – my attention to detail lapses.
Figuring out how to get the computer to catch your mistakes is the interesting bit.