I have been working in the IT industry for the last 13 years and I was diagnosed with ADHD around two years back.
As part of my job, I have to look at a lot of code. It used to be that I used to write a lot of it, but recently since getting promoted, my work now revolves mostly around reviewing the code others wrote or sometimes enhancing someone else’s code.
The problem comes when I come across some extremely convoluted legacy code. For example, like a function hierarchy with 10+ levels of function calls across several hundreds of lines. This causes me some problems understanding what’s going on because it’s nearly impossible for me to follow every branch to understand which part of the code needs fixing. After a while traversing the function calls I often forget how I got there and have to retrace my steps (I use debug breakpoints but it doesn’t help much). I also tend to get distracted with ideas of how to re-implement the whole thing with best practices rather than focus and work on delivering the fix that I am expected to do. This severely hampers my turnaround time and I’m sure my supervisors are frustrated.
What baffles me, however, is that my other colleagues look like they have no problems working on this codebase. So I cannot really blame the badly written code before my supervisors.
So I just wanted to ask anyone here who has ADHD, works in IT/Software Engineering how do you cope with a situation like this? Also, does medication help here?
I used to be on Atomoxetine, but after experiencing a nasty anxiety attack, I stopped about a month ago. Not that I observed any major improvements while I was on it.
PS: Apologies if the context does not make sense to any of you non-IT folks. I can clarify if you ask.
Others have covered this well. From my experience (35 years), most “developers” write stream of thought code. It reflects how their brains process, without regard to others. When I have agency, I can steadily refactor the code to reduce indirection, nested if.then, etc. When I don’t, I’m in danger of being too slow in completing the work. Just lost my job for that reason while working with a 1000 line service entry method with a cyclomatic complexity of 310 and 34 class parameters. Coupled with being the acceptance tester as well, it makes it near impossible to succeed.
For extremely complicated code I used to create simple diagram sketches that illustrated the dependencies. It acted as a series of bookmarks to help keep my place. I think I have a smaller “working space” in my mind than non ADHD programmers. I think they can keep all that complexity in their mind at once while I cannot.
In a way, I turn that into an asset by writing code that I can reason about, which by definition requires it to be SOLID, and with minimal responsibility per function.
Lately, I’ve been using AI to generate sequence and class diagrams of the code to act as a high-level view of what’s going on. Major time saver.