Skip Navigation

A question for ADHD-ers working in software development.

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.

33 comments
  • Ironically these types of tickets are kinda my ADD superpower. I hyperfocus on understanding the entire flow until I fully understand every possible way the bug could occur, then fix it.

    It's when I'm trying to plan something from the ground up that the writer's block hits me and I fall into procrastination and infinite rabbit holes till pressure is applied externally.

  • Dev with 18-20 years of experience. I was originally diagnosed in the 90s. Stopped taking meds (Atomoxetine) recently because I hated how they altered my mood.

    It’s not just you. Your colleagues probably have the same struggle but it just hasn’t been talked about yet. Any time I’ve brought up a gripe about something, I’ve always had colleagues chime in and agree. Any time I have to traverse complex code like that, I have to have like 5 panes open in VSCode and sometimes I have to take rough notes, or diagram it out.

  • 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.

  • I don't work in software, but networking, where I often have to work in CLI for configurations on multiple devices simultaneously. What I've been taught, and what's worked for me, is drawing logical diagrams by hand with pen and paper when I'm working in a system that I think has the complexity level to get lost in. I don't know for sure how well that will translate to software in general unfortunately.

    Where that line is varies person to person, so you might only do it for those weird legacy systems. That's usually how it is for me. This is how I best understand things in general. Laying them out physically in front of me and writing it all by hand in the format that I Intuit really helps me keep track of exactly where I'm working on what

  • I don't know about intellij, I have worked mainly in VS Pro. I will tell you some of The things I can do in VS that help and then I'm sure intelliJ probably has similar functionality or plugins that will add it. Check to see if you can generate call graphs or call maps. VS enterprise has the ability to add each function to a graph and build up a diagram for you. Unfortunately pro and standard do not.
    Ctrl + "-" will jump back to last. This allows you to reverse through the call tree.
    You should be able to display a call stack that at least tells you how you got down to where you are.
    Make notes about reimplements you want to make and move on. Sometimes just writing it down so you won't forget is enough for my brain to let it go.
    In VS Pro you can create a break point and then right click on the red break point dot and add conditions and\or actions. Conditions stop it from breaking there unless a condition is met, this is great when you only want to catch one iteration of a loop. Actions are something that will be evaluated and done like printing out information "$FUNCTION, myvar {my var}" will print out current function name, myvar, the value of myvar". You will be surprised how complex of a variable it will print. For instance it may print out an entire structure or contents of a class. You can then set the action to not break, that way the code performs the action and keeps going. Doing this will allow you to generate as detailed a list as you want of breakpoints in the order in which they get hit plus any variables you want to track.

  • I'm a fairly early career dev, my job doesn't really give me a lot of opportunity to write new code, instead I spend most of my time updating other people's code, much of which is a legacy rat's nest. Most of my time on a given story is spent trying to understand the code I'm given, and as I'm reading it I often feel like my eyes start drifting apart, it's really hard to focus on it and understand the meaning.

    The two most helpful things I've found are a) diagramming everything out. For that I have a big white board next to my desk, like 15 scattered notebooks and a tablet for onenote. b) my medication.

    I was put on Ritalin about a year and a half ago, and (when I remember to take it) the difference is night and day. I wouldn't say the medication makes the work easier, but it does make me feel motivated to do it and be less distracted even though it's not work I necessarily want to be doing.

    I do feel I should mention since you mentioned having some anxiety issues on other medication that I can end up with the save issue, but I've noticed that it only happens if I didn't eat before taking it, or take it too late in the day to where it's still fully in effect after I'm done working.

    I also absolutely feel you on wanting to refactor everything that doesn't make sense - it would make life so much easier, but I'm not allowed to do it -_-.

  • 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.

33 comments