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.

  • LuxSpark@lemmy.cafe
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    12 hours ago

    I personally doubt many people are good at this, ADHD or not. Anyway, logging is the best way for me to “see” what’s going on. If you can output the name of the functions when they are called, you can see the order of what’s happening. Then, hone in on certain areas and add more landmark output statements to show major steps and intermediate results until you locate the problem.

    Meds can help the focus required to stick with this tedious process. Logging is a great tool, and even better if you take the time to make it configurable.

    • deathmetal27@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      12 hours ago

      I avoid adding logs because after I’m done, I will have to remove them otherwise my PRs will be very big depending on how many files I have to update. I instead track the call hierarchy of the function I am studying using a feature in the IDE. It basically creates a tree of all functions called by a function, which helps me track how deep I am and how I got to where I am currently.

      I should probably resume my medication though.

      • LuxSpark@lemmy.cafe
        link
        fedilink
        English
        arrow-up
        2
        ·
        11 hours ago

        That’s cool, is it visual studio? I guess it depends on the system, but if you have good log files, you or anyone can troubleshoot problems without even looking at the code.