DEV Community

Discussion on: How does flimsy code affect your mental health?

Collapse
 
matthewbdaly profile image
Matthew Daly • Edited

This is something close to my heart. I maintain a large legacy application with many serious issues. After four years of me spending maybe 80% of my working time on this project, it's improved significantly, but there's still plenty of stuff that is downright painful to work with, and it's virtually impossible to write any kind of useful automated tests for this project.

Static analysis is an absolute godsend, and Psalm has caught a huge number of potential issues, but the code base has substantial gaps in the type coverage, so some type issues will still get through until that's remedied. Fortunately this application is an intranet system rather than something web-facing so there's a limited pool of users and we only have to support the web browsers they use, but it can still often be nerve-wracking to push a change live.

Fortunately my colleagues are conscious that this is the case and are very supportive, but the mental load of this code base is higher than just about anything else I've ever worked on. As such it can really be a strain to work on it at times. At this point in my career I know my own limits fairly well and generally know when I hit a wall and need to do something else for a bit, but I have struggled with burnout from time to time on this project. It can be very, very frustrating when implementing a feature takes many, many times longer than it should because it needs to be built on top of existing bad functionality and there's no scope to rebuild it the way it should be built right now. In addition, getting into the highly productive state known as "flow" is much, much harder when working on this project.

We're sincerely hoping the client will agree to our proposed rebuild soon...

Collapse
 
kienngo profile image
ken

Wow i thought I had a terrible experience with a legacy codebase which is a mix of AngularJS & jQuery but yours is clearly worse. I spent 2 years on that crap. Learnt a lot but it took a toll on my mental

Collapse
 
j143 profile image
Janardhan Pulivarthi

Sometimes I wake up at nights thinking about the future of the legacy code I maintain. 😥

I add a commentary of few points about what to upgrade (which possible version), which components to remove, few supporting life quotes in the developer notes in the repository.