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.
I don’t write code, except for some sql queries used for verification, but do have an understanding of code and have reviewed code with developers when trying to ensure it functions as intended. Have adhd and while I often get praise for being able to understand and convey complex functionality and software concepts, the ever changing code bases is intimidating and keeps me from diving into actual development.
One thing that really helps with reviewing older, especially nested, code is drawing out a simple flowchart. Well, simple unless there is some kind of spaghetti logic that makes it complicated, but frequently just drawing out a loop or indicating when something is changing in the middle of the process can identify where the problem is in a way that is far easier than breakpoints.
I also have some level of aphantasia so I can’t visualize a workflow that I didn’t create, which could be a part of why this works for me, but using it to explain where the code is failing is a lot easier too when you can point at something and say “when the person resets to this step then x, y, and z are reset correctly but when a reviewer resets to that point it is only resetting x and z” because that step needed x, y, and z to be in a particular state.
I don’t exactly draw flow charts, mostly because the nodes don’t make sense to me without context. Instead, I read a few lines, understand what’s going on there and then write down the gist of what I understood. I write these down as bullet points with nesting to track branching code. If still find it pretty cumbersome.
TBH, this wouldn’t have been that big of an issue if the code was commented or documented properly. But then again, who is going to go into code written back in 2018 to document lol.
I’m sure it’s much more common among developers to not understand another developer’s code.
I do mutter the behaviour of the code to myself when studying like you described.