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.

  • Test_Tickles@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    15 hours ago

    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.