How to reduce maintainability cost of code — review your code.

Makavura Mughanga
2 min readMar 2, 2020
Photo by Vladyslav Cherkasenko on Unsplash

How to write maintainable code & why — you have settled down and you are as many like to say, in the zone. The problem that needs to be solved is clear in your head, you know what, why and how. Line after line you write, and it works! How many of your days are filled with this kind of work, new, productive, creative and satisfying work?

How many of your days in a month do you spend refactoring code, fixing someone else’s bugs or trying to understand just what in this green earth the other party(It could be you) was trying to achieve?!!

Let us be honest with each other, in some instances, we developers, read more code than we write, some are even better at reading code than writing it.

But is that what you should be doing? Reading code? Wouldn’t you rather be crafting out line after line, and singing out ,”I feeeeel good!”

A simple idea on avoiding maintainability hell, but first, what is maintainable code? Questions to ask yourself:

  • Is my code readable and explicit?
  • Is it consistent and predictable?
  • Is it properly documented? Or will someone need a PowerPoint presentation on “just what is going on?”?

What a good feeling when after writing code the first time it works just as you had intended. But is it the best code?

Review your code — we can be very good critics of ourselves, if we apply to ourselves the same measure of excellence that we expect of others. Usually in the midst of a headache, 7th cup of coffee and the desire to make the one who wrote the code you are now debugging, to explain themselves. But you can’t, they are asleep for some reason and you are cleaning up their work.

If someone else was reading your code for quality approval, refactoring it or tracing a bug, what would you like them to see?

Got a list? Well, what are you waiting for? Open up that editor and review your code.

Chances are you will be surprised as much as I am about to be on what I can improve on, any who, lets get coding!

--

--