Love-hate relationship with code mess

Have you ever seen a job offer for a software developer with something like your job will be to maintain our legacy system written in [ name of long-forgotten framework ] with over 100k LoC?

I haven’t.

Because in the software world it’s a bit like putting I have HIV phrase in your Tinder description. There are specific people who would be attracted to it (more about them here) but most of us would rather swipe left (or scroll down to the next job offer).

There’s one simple trick however which could change my mind. It’s one word.

Clean up.

People hate mess. Since the beginning of civilization. As human beings we enjoy order. But at the same time, we usually don’t enjoy maintaining order. That’s why we have a washing machine and dishwasher in most homes.

Humanity has a love-hate relationship with the order. On one hand, in most cultures, people who maintain it are perceived as a lower class or at least disliked: domestic servants, cleaners, police, bureaucrats. But at the same time cleaning up the mess is something heroic. The most well-known example is the fifth Labour of Heracles, which was to clean the Augean stables. The stables have been something like ancient 10M LoC legacy software which doesn’t even compile. TL;DR it was 3,000 cows and 30 years of manure (lack of compilation was caused by the immortality of the livestock). Heracles solved the problem, so to speak, by automation (here are the details). Then he became a well-known hero.

Another great ancient figure considered great after cleaning up the mess is Hammurabi. His method was to introduce some collaboration standards. For example, if someone breaks your build you can break his as well (§ 197). Historians say that the mess started to decrease after his code of conduct was published.

To sum up – maintenance: not cool, clean up: cool.

Unfortunately, more often than, nobody is truly interested in cleaning up the mess when it comes to software. What seems to be a goal of the organizations in most of the cases is to keep the mess alive and somehow productive. It’s understandable but dangerous. Middle management comes and goes, software developers also. Everybody wants to deliver results. But there’s a point of no return on this path. It’s a moment when the development of new features is almost impossible and the maintenance of old parts is ridiculously expensive. New developers don’t want to join the company or leave as fast as they can. Old developers are the only people who somehow know what’s going on in the system, but even they are unable to meet the deadlines. Technologies used in the project are so old they aren’t even supported. Everyday work is like a bath in the manure of 3,000 cows.

It can be avoided. By clean up on time.

Personally – I like to clean a mess. It gives me a pleasant feeling of doing something truly important. I don’t want to say I feel like Heracles, who saves the company from bankruptcy. Oh, well. Ok, maybe a bit I do. Anyway seeing every day how something which is a nightmare of future colleagues becomes an organized structure is satisfying.

Exactly opposite is feeling that every day, with every line of code added to the repository I’m feeding the monster which will digest some developers in the future. I feel it’s irresponsible to do it. It’s like allowing the organization I work for to have a bad habit which brings it happiness today but will give it cancer in 10 years. It’s amoral.

The best way obviously is to maintain a healthy lifestyle since the beginning. Coding standards, code reviews, automated tests, well-crafted architecture – all of us know it. Many of us ignore it. An important thing about the mess is that order indicates the development level. When we look at countries we see chaotic streets of India and well-organized streets of Europe. At first sight, we see where people can be more productive, happy and wealthy. We shall not allow the organizations we work for to fall into chaos.

Busy Calcutta (Kolkata), India street traffic.
France

Leave a Reply

Your email address will not be published. Required fields are marked *