A common (maybe the most well-known) symptom of ADHD is being easily distracted and unable to maintain focus on a single thing for very long. However, many people may not realize that the opposite is also a symptom – the tendency to hyperfocus on a single task for hours on end to the exclusion of others. In a psychiatric sense, this is called perseveration, and it relates to difficulty in task switching. It is important to realize that attention deficit does not mean the lack of attention, rather it is the inability to properly modulate attention. In this case you find it difficult to actually stop focusing on something.
Hyperfocus is seen often in the developer community under the guise of “being in the zone.” It is even self-selecting for software engineering, as it is a behavior that greatly lends itself to the demands of development. Those exhibiting actual signs of perseveration may not realize it as such, as getting good code momentum going is quite common, yet they can take it to extremes.
Have you started working on a programming task only to look up and realize it’s twelve hours later, you’ve barely taken a break, and now you aren’t going to get any sleep? Have you wondered what that odd pain in your stomach was while contemplating an annoying bug only to realize you’ve forgotten to eat? Have you felt unreasonably angry for being interrupted while in the midst of an intense coding session? Have you tried to get started on a new task only to find you are inexplicably drawn to attend to some external stimulus no matter how hard you try to block it out?
These have all happened to me. While the first two and similar cases can be great for churning out code, especially at crunch times, the downsides can be quite aggravating. For instance, it is incredibly difficult for me to get any work done if there is a TV on that I can see or hear. It doesn’t matter what is on, I will frequently lock onto it, thus preventing any consistent focus on work I may be trying to do. I’ve even trailed off in the middle of sentences because something on a TV arrested my attention. I’m amazed people can get programming work down while listening to podcasts, audiobooks, or TV shows, as my productivity plummets whenever I attempt it.