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!
The good
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.
The bad
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.
The hyperfocus
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.
Great point!
And there might be a general metaphor for living with ADHD here — you can’t get rid of symptoms like inattentive mistakes, but you can find creative ways to cope, “outsource” your executive functions, etc.
was there a book or a process that you found helpful when learning to code?
Great article!
One of the problems with hyper focus is latching onto things that stick out like fixing code style when you should be solving another issue. I have wasted so many hours trying to clean up existing code that already worked just fine. I usually get lost on these side-tracks when my attempt to fix it causes more problems. I forget all about my original goal.
Setting a timer helps so that I can walk away from my computer for a few minutes. I have to decide what I’m going to do before looking at the screen again, or I’ll get pulled right off track when I see what I was working on, usually because I’ll get some brilliant idea of something else to try.
That’s the thing with ADHD — it’s not that we can’t focus, but often we focus on the “wrong” thing, which can really get in the way of using time efficiently. Thanks for sharing your experiences with this!
Thank you, I’ve enjoyed reading the article so much.
I’m a programmer with ADHD, and i have always been thinking that hyperfocus is the peak of my life but never really had any thoughts about it. Thank you for the inspiration ☺️
Thanks, Shini! 🙂
I literally just google’d “ADHD and learning to code” and landed on this article. I am in the middle of a HTML5/ CSS course, and I am really struggling. The biggest problem I have isn’t the concepts, it’s attention to detail. For instance–mistyping a linked file name by one letter and spending absolutely forever trying to figure out why the link won’t work. I especially run into problems when I decide to change anything. Changing and or moving things around creates endless possibilities for me to screw things up and then spend hours trying to figure out what happened. I sometimes take most of the day on an assignment because of this. The more stressed I get, the less likely it is that I will “see” the problem. It’s extremely frustrating and demoralizing; not to mention stressful.
However, I just learned about and installed HTMLhint in VS code. I’m not sure why our teacher didn’t tell us about it sooner! It’s going to save my life!
I also relate with Brenda–I spend a lot of time sidetracked by things that aren’t that important but as she says, “stick out like a sore thumb”. Boy, do I ever relate to that. If you add that to the inattentive problem, the time it takes me to finish an assignment can really add up to countless hours–hours I need to be spending on other classes! (Not to mention taking care of my kid and everyday life stuff).
I know I could be good at this if I can ever learn to overcome/ manage these two issues.
Thanks for sharing your experience with this, Gillian! That’s the thing about coding — even a trivial mistake can become extremely time-consuming to find and fix. Fortunately, I think it does get somewhat better as you learn to recognize the different kinds of mistakes that are possible more quickly. Best of luck!
I was diagnosed 5 years ago with ADD and have been programming for 20 years now. Ritalin really helped me out. Getting side tracked and searching hours for stupid mistakes still happen occasionally. (Love the hyper focus though)
Agile programming is an other method that helped me tremendously getting organised, and its fun/engaging too using card systems like trello. https://www.atlassian.com/agile. https://trello.com/
I can pretty much relate to everything you have said. I am trying to decide whether I should do this coding course I want to do but I’m afraid that I might be wasting my time and money. I get hit with executive disfunction on a regular and at random times. It’s the worst feeling especially when there is a deadline. Anxiety has given me the ability to work quickly and in hyperfocus to get to the end of a project. I have always wanted to learn coding, it’s just overcoming my fear of failure that has stopped me. I will give SheCodes a try and see how I go. I know I’ll figure it out eventually because I thrive on learning new skills and I know this will be good for my brain. PS I was diagnosed with ADHD at 44 years old last year.
I started programming about a year ago, and I love it – as long as I remember to take my ADHD meds.
Otherwise, I get sidetracked, forgot what I wanted to do and get overwhelmed with details of functions I haven’t even started to write yet.
Ha, yeah, it can definitely get chaotic trying to think through those things in advance. I guess it takes the right combination of planning ahead but not trying to figure out ALL the details before starting. Thanks for sharing your experience!
I’m a long term software engineer/programmer/whatever (30+ years) and I’m going through the process of getting an ADHD referral (very slow). I’ve always struggled with the mundane and get distracted easily. Like today I decided to do the official MBTI test (ENTP which concurs with other online free tests) instead of trying to fix some absolutely rubbish enterprise Java.
I love meeting users, understanding their needs, delivering what they want. I detest the modern workplace where there’s so little autonomy, where programmers are seen as non-unique, replaceable parts. I love creating solutions for real people “delighting them”, but this software I’m fixing is joyless (Spring Boot, Camel, JMS) – nothing just flows. “Annotation hell”. There’s zero chance of getting in the zone or really focussing. Incredibly frustrating.
I am in a dilemma; do I pay (£700+) for diagnosis, or save the money and suck it up. I don’t like wasting money if it just turns out I’m a lazy sod! Yet another wild goose chase looking for answers!
Anyway, thank you for the great article! I shall check out your site as I discover this ADHD thing.
Hi David, thanks so much for sharing your story! Your conflict between enjoying what you do but feeling stifled by your work environment will definitely resonate with a lot of ADHDers. I can’t put a number on the “value” of seeking a diagnosis, but I know that for me and for many with ADHD, it can be a life-changing experience — a huge step toward understanding the challenges we’ve faced and better managing our symptoms. Best of luck!
This describes my experience with being a programmer to the T.
I feel like this describes me pretty well
I am a senior software developer. I have just started looking into ADHD because of one of my daughters. I always suspected that i had it. I do. I have been in software development for 22 years. What I will say is that it has definitely been difficult sometimes. But there are advantages with the difficulties.
For starters – most other people that I worked with in the begining understood things and made things work so much faster than me. My stuff didn’t work as well and had many more problems. But realistically — my biggest problem was step by step instructions. In the real world there is no – click here then type this. There is I need a list of the employees that made top sales this year. By the time I was doing real world stuff I was better than most people with the same experience and a lot with more. – Why — because if your code always works when you follow the instructions you only know how to make things the way you were shown. — Guess where most software development time is really spent. Fixing problems from someone else. Sometimes problems that were introduced by something new, sometimes problems that were always there and aways it was the wrong way, it was just never noticed. Because I had to struggle so much — I was better. Because I had learned how to fix things that others had never seen. I still have more code errors than others. I still miss things. But I have the large concepts, I have the understanding of what breaks common errors. I have also learned coping stratagies that help me and others — when I type a variable — I only like to type it once. from that point on it is copied and pasted to the new location, because I can’t tell if I type it wrong. This has worked many times when I checked out other peoples code. So I would say — and do — struggle away. The key part here is do you like software development — the process — fixing problems, creating new things for other people or for yourself. If you do software development continues to be one of the most in-demand jobs in the world – so stick with it. Also when someone asks how much you make, add 5 or 10k to your current salary — this helps you get a much better raise and not have to negotiate so much.
Those are great points. I think that because people with ADHD have trouble following “step-by-step instructions” from others, as you say, they sometimes develop an ability to work things out independently in order to cope, which can be very helpful in less structured settings!
I remember sitting at my dinner table crying over my homework. My dad came in to see what was wrong and to offer to help. I hadnt been paying attention when the teacher taught long division a few weeks before and the steps didnt make sense to me, so I had been doing reverse multiplication and guess and check to solve every problem for weeks. He patiently explained to me again the steps to long division and it was simple after that. Im also a bit better at reverse multiplication than I would have been, for what it’s worth
This is a great example of how ADHDers can miss some important information and end up spending a lot of energy as a result! Thanks for sharing this story!
This article is spot on. I am about to visit a psych now in my 40s, and so my only question is: will medication take away the positives, like hyperfocus or thinking outside the box? I struggle a lot with my ADHD lately but I also know that I have so many coping strategies and by now feel like it has become a bit of my superpower in solving stuff.
I had similar questions when I first tried medication. What my psychiatrist pointed out to me is that you can always try medication for a little while and see how it affects you — it’s probably the best way to get the answers to these questions. Best of luck!
Great article! You are right about the learn by doing projects approach, I can almost never sit through or finish a course on any language/framework but when you learn by doing I realised that I miss many concepts even after making the project simply because they were’nt used in project and then my knowledge feels incomplete. Is the only way around this problem is to work on as many projects as you can?
Thanks, Devansh! Yeah, really the best solution I can think of is just more hands-on experience that forces us to learn different things and fill in the gaps. Teaching programming and helping others with programming projects also helped me in this regard because people would ask me about topics that I otherwise might not have explored on my own!
Just know discovering that I have ADHD at 57 (self diagnosed at this point), but I think another symptom that is bad for ADHD programmers is the tenancy to way underestimate how long things take. Might not make if you are independent but estimation is important in scrum teams
Hi Dale, that’s a great point! Many people with ADHD have a tendency to underestimate the time required for all kinds of things in everyday life — it’s probably a combination of not thinking through all the details, not planning carefully, executive function deficits, etc. You’re definitely right that this tendency could show up when planning out some kind of programming project, possibly to the annoyance of colleagues, etc.!
I can’t say if this is an ADHD issue, or maybe just my experiences. I don’t get around, so I don’t know many high level developers or what other developers are doing. How do you handle interviews? Not only do I have ADHD, but I am also introverted to an extent. I always feel like I should be able to explain more, but at the end of an interview, feel I haven’t explained anything. However, if they just gave a project to me, I think I would blast it out of the water. I have been working at a company for 12 years (from intern), and it wasn’t the best experience. I am sure my ADHD contributed, but loved the work, not the people or management. I did have a contract job for a bit, due to circumstances, but that was my best interview, and all I said was “Look, if you give me a chance, I’ll do whatever you need. If I don’t know it, I’ll figure it out.”
How do you handle interviews? I’m not sure if this is because of ADHD or maybe just a general feeling, I am also introverted, but I always feel as if I explained nothing at the end of an interview, as if, I was just listing off some things I heard about. I’ve worked at a company for 12 years (from intern) to give context, but I do have ADHD. It was toxic, but I loved the work, not the people or management.
During my best interview, I just said “Give me a chance, and I will do it. If I don’t know how to do it, I will figure it out.” Personally, I prefer they just give me an interview project to work on.
i don’t know sometimes finishing the project could be very hard once feel disengaged from the project, also the major problem is frustration.
I was a programmer ,when I was living with undiagnosed ADHD. Now when I look back I feel my Impulsivity didn’t allow me to think deeper to resolve problem/error/bug in the code. The constant racing thoughts pushed me not to settle for one solution while fixing a bug.