Obsession with beautiful code, refactoring syndrome
Recently, an obsession with refactoring has spread. It comes to the fact that some programmers put him a higher priority than the more important things, such as:
Correctness
Reliability
Traceability
Maintainability
...
If this goes to extremes, and all the programmer cares about is the beauty of the code, it can fall under refactoring syndrome. This syndrome has the following symptoms:
Complete disregard for the code of other programmers.
Obsessions with variables and methods.
Abuse and revaluation of unit tests.
Complete disregard for any kind of documentation, architecture or analysis.
And usually the consequences are:
Integration errors.
Lack of reliability.
Loss of performance
The main question to the refactoring syndrome is that it is based on the beauty of the code, and it has three big problems:
Intolerance. All code is crap. This is one of my favorite quotes, and is proven by the following facts:
The principle of exclusion. All programmers tend to think that only their code is the only good code in the universe.
The principle of obsolescence. As a programmer, since you are learning something new, you also think that your old code is crap.
The principle of experience. I have never seen code that would be considered completely good.
It is not so important. Even if the code is good, it does not mean that it is correct, and by the way, the correctness of the code is a thing more important than beauty.
Wrong perspective. Focusing on the code directly, and not on the application as a whole, makes the programmer forget about the other more important parts of it (the application).
This refactoring syndrome seems to be related to the latest popular trends, when programmers confuse tools and technical principles like TDD, refactoring, unit tests ... with what really needs to be done. This is comparable to a builder who believes that having new tools is more important than the house he is building.
It is important to understand that none of the tools or principles of development is not bad in essence. Only the fact that we abuse them brings us closer to the refactoring syndrome.
As a result, it is important to remember that:
No matter how beautiful your code is, if it doesn't work.
Refactoring only when it is needed, and not when you do not like the code. Lack of sympathy for something is NOT reason enough to change it.
Unit tests are very limited when it comes to integration. Do real, manual testing !!
Know the various tools and technical principles, but do not use them as dogmas. Learn what's good and bad with each and apply when necessary.
Good programmers keep making good software, bad programmers keep making bad software, no matter what method they follow.