Spaghetti Code Nightmare: How to survive a Legacy Project

Kirubakaran
4 min readAug 19, 2024

In the world of software development, a few lines of scrambled code can make life difficult for someone who has no idea how to write code. On the other hand, it’s not guaranteed that the end product will work as desired even if a programmer carefully considers all the nuances.

Are we hopless then? No.

From Bhagavad gita, “You have the right to work only but never to its fruits. Let not the fruits of action be your motive, nor let your attachment be to inaction”.

Because, with the multithreading and multiprocessing, the amount of race condition can occur theoritically exceed the atom limits in the known universe🙂. The coverity run/static analysis tool checks can detect a few, but admittedly it also has limitations.

Picture credit: Clem Onojeghuo from unsplash

Take a good example of my friend Rahul who has been through many programming wars. On one ordinary day, Rahul is given what appears as an ordinary task; updating a critical module in a huge legacy codebase. They did not know it at first that this simple task would put them into sleepless night and frustration.

--

--

Kirubakaran

Software Engineer expertise on C, C++, Golang, Python, Docker, Kubernetes.