Code Maintenance Part 1 — The Why

Viral Shah
3 min readJun 17, 2023

--

We’ve all seen this story. An enthusiastic new developer joins a team and immediately starts pointing out issues.


Hey, why does this system take so long to start up?
Why aren’t you guys using XYZ?
Why haven’t you updated this library yet?

And what do we tell them?

You see, it’s quite complicated. You don’t know the whole system. There are many interrelated dependencies.
Do not touch that code!
We’ve tried doing it in the past. It breaks everything…And my favourite, We’ve added this to our backlog as technical debt.

If it ain’t broke, don’t fix it!

If you are a software developer, you’ve probably heard this phrase at some point in your career. This “wisdom” often comes from years of coding experience. From being the enthusiastic dev yourself at some point, who tried to refactor everything and broke it. At that time you promised yourself, never again!

If it ain’t broke, don’t fix it

The Why

Imagine buying a brand new car and not maintaining it. No cleaning, no changing oil, no rotating tyres or checking tyre pressure. In fact, every time something goes wrong, you do not go a mechanic or a service centre. You just add whatever temporary fix you can and forget about it. You hack it until you can hack it no more, and then if your car dies on you, you just go and buy a new car.

Sounds ridiculous, doesn’t it?

Recently, I had a plumbing issue in my house. The plumber came in and did some basic inspection. He took one glance and understood the issue. He was a professional. He fixed the problem in 10 minutes. And then he took 30 more minutes to fix another related issue, which I had not noticed and had not asked him to fix. Mind you, he did not charge me anything extra for this additional work.

Why did he do so? I’ll tell you why…

Because he knew that was a disaster waiting to happen.

Because he knew he could make things better.

Because he is a professional who takes pride in his work.

Lifecycle of a software

Most software doesn’t just randomly stop working. It usually starts off as a shiny new piece of tech. Then it slowly starts smelling. Over the following years, different developers visit the stinky code. Instead of cleaning it up, they cover it up by adding their own hack on top of existing hacks, until the hack mountain starts stinking so bad that you need to bring in experts. Snooty experts come in, condemn the work of their predecessors, and recommend bulldozing the hack mountain to make way for shiny new software…And the cycle goes on!

Maintenance is the norm in all industries & professions, why should it be any different for software developers?

As “professional” software developers, we shouldn’t ignore software maintenance. To anyone who says that code maintenance is time-consuming and is very costly, I would like to share an old saying in the construction business,

A dime of routine and preventive maintenance is worth a dollar in repairs.

Also, do you know what else is time-consuming and expensive?

Production failures and system downtime, building a new software and getting yourself involved in long and expensive litigations.

I’m glad you read the entire thing 🤓

Do you agree with my thoughts? Do you have something you would like to share? I would love to read your thoughts and experiences.
Please leave a response below.

I ❤️ software development & enjoy writing articles about it. But they do take a lot of time & effort. If you have enjoyed this article please share & recommend it.

Happy coding!

--

--

Viral Shah

Passionate programmer, Wishful writer, Rookie gamer, Potential philosopher