
Code quality is usually underrated in some organisations because it is an aspect that customers don’t see and don’t pay for.
However, it is quite important in both the short and long term. I will expose some of the reasons.
Allows to develop faster
Developers can work faster when the code is clean and easy to read, and in case of doubt, they can look at the tests to see how the main code should be used. They are also more confident about making changes when there are tests because they have a safety net that will detect if they break anything.
It is already documented
People think about documentation as writing long texts in wikis or docs. However, the best way to document code is by using proper method and variable names and adding tests that explain what the code does in a format such as “given a scenario, when this happens, the system should behave that way”. That way, the code is self-documented, and it is much better than adding comments or documents that nobody reads, and that soon get updated.
It sets the bar for new code
In 1982, two researchers proposed the broken windows theory. They observed that gangs in New York respected the houses that looked clean but vandalised the ones that looked abandoned.
The same happens with the code. When people start cooperating on a project, and they see that it has good code and is tested, they force themselves to maintain the same level. However, they may not do the same in other projects that have bad code and no tests. Also, when a project is in good shape, the owners find it easier to force new contributors to do the right things because that is the standard of quality of the team.
New code without tests is already legacy
People usually talk about old, unmaintainable code as legacy. However, every time a new line is added without tests, it becomes legacy too, as only the person who wrote it knows the impact of changing it.
Lack of time is not an excuse
We all know how tight deadlines can be when we work for startups. We have to deliver features faster than competitors all the time, so we can get customers that allow the company to survive a few more months. However, there are also some calm periods when we can go back and improve the testing coverage and those parts that are not as good as they could be.
I have highlighted some of the reasons why it is important to have good quality from the beginning. How is it in your team? Do you make an effort to keep it clean and tested, or does the fast pace of work not allow you to do it?
As always, I would love to read your opinions in the comments below.

Leave a Reply