
Obsession with beautiful code, refactoring syndrome
An obsession with refactoring has recently spread. It comes to the point that some programmers give it a higher priority than more important things, such as:
If this goes to extremes, and all that the programmer cares about is the beauty of the code, he may fall under refactoring syndrome.
This syndrome has the following symptoms:
And usually the consequences:
The main question for refactoring syndrome is that it is based on the beauty of the code, and this has three big problems:
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 development tools or principles is fundamentally bad. Only the fact that we abuse them brings us closer to refactoring syndrome.
As a result, it is important to remember that:
- Correctness
- Reliability
- Traceability
- Supportability
- ...
If this goes to extremes, and all that the programmer cares about is the beauty of the code, he may fall under refactoring syndrome.
This syndrome has the following symptoms:
- Complete ignoring the code of other programmers.
- Obsessions with designation of variables and methods.
- Abuse and revaluation of unit tests.
- Complete disregard for any kind of documentation, architecture or analysis.
And usually the consequences:
- Integration errors.
- Lack of reliability.
- Loss of performance.
The main question for refactoring syndrome is that it is based on the beauty of the code, and this has three big problems:
- Intolerance. All code is shit. 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 your old code is crap.
- The principle of experience. I have never seen code that I would consider completely good.
- This 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 its other more important (application) parts.
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 development tools or principles is fundamentally bad. Only the fact that we abuse them brings us closer to refactoring syndrome.
As a result, it is important to remember that:
- It doesn't 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 a 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 each is good and bad, and apply when necessary.
- Good programmers continue to make good software, bad programmers continue to make bad software, no matter what technique they follow.