deathmetal27

joined 2 years ago
[–] deathmetal27@lemmy.world 1 points 3 weeks ago

The title reminds me of this https://xkcd.com/2584/

[–] deathmetal27@lemmy.world 1 points 1 month ago

No, IntelliJ IDEA. I do add a lot of logs in my own code though.

[–] deathmetal27@lemmy.world 0 points 1 month ago

Anyway: What makes the difference for me: taking the time to think about proper solutions. Let some problems rest for a day and reevaluate the things I made the day before, before review, merge or deployments.

I agree, I do this when I am designing some new module. I tend to write detailed design documents, covering as much behaviour as possible. I then get it reviewed by someone who might have a good understanding of the business process related to the change. This is not very feasible for legacy code because often there is no proper documentation or comments. What I'd prefer in such cases is to implement new modules in a manner where it lies somewhere outside the legacy body of code (different package or module) and expose functions to hook into the legacy code. This way at least the new enhancements follow best practices and don't become just another patchwork to the increasingly unmaintainable legacy code.

Back to your original problem: legacy code like that is probably hard for everyone but it makes a difference in what pace (or patience!) you are doing your work. I think medication can help you with that :)

True. I have been thinking of resuming medication myself.

[–] deathmetal27@lemmy.world 1 points 1 month ago

Yeah, I use bookmarks and mnemonic bookmarks as well.

Creating a rough git branch is a good idea though, I should do that. Currently, I try not to modify the code too much when studying so that the code because I would later have to revert them back otherwise it would confuse the PR reviewers if there are too many formatting changes not relevant to required changes.

[–] deathmetal27@lemmy.world 2 points 1 month ago (2 children)

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.

[–] deathmetal27@lemmy.world 2 points 1 month ago

Until you have to fix some bug some dude introduced seven years ago and is no longer working at the company.

[–] deathmetal27@lemmy.world 1 points 1 month ago

I tried doing that, except instead of drawing diagrams of the flow of execution, I write down a gist of what I understood after reading a couple of lines. It's still pretty hard to do because interpreting what something does is hindered by things like function or variable names often don't always align with their actual purpose or even not adequately descriptive either. I often find myself muttering "Why the fuck is this written this way."

I guess legacy code is the bane of everyone with ADHD.

 

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.

[–] deathmetal27@lemmy.world 1 points 1 month ago

Shit come down