02.09.2024
**Tags**
#areas/dev #areas/reading
# On Measuring the Quality of Code
> The only valid measurement of Code Quality: WTFs/minute
The book is off to a good start. It correctly caricatures the ability to determine the quality of code as "good" vs. "bad" as something that is unscientific. The measurement, whatever it might be, does not allow you to produce and reproduce a clear output given a piece of code or an entire codebase as an input.
Using empirical measurements, we might be able to identify what programmers agree on when it comes to "good" or "bad" code. However, even if we had active scientific research in this area, we do not see much scientific results uset to base discussions on.
We are left with opinions – of others and of ourselves – more often than not . When we start a career as a developer, we are largely influenced by the opinions of others. As time goes on, we gain more knowledge and our opinion become more influenced by our own experience.
We will use those experiences to form a framework of opinions and heuristics, and we will adapt or reject opinions and heuristics of other programmers. This is why there is still no clear consensus on the definition of “good code”. Uncle Bob has built his own framework and titled it *Clean Code*.
*Clean Code* doesn’t claim to be the “only right” way to do things. Bob presents *Clean Code* as one and – from his point of view – the best way to solve problems, and achieve good solutions.
Another noteworthy aspect is Bob’s assertion that you can’t expect to achieve *Clean Code* without putting in the work. Just reading the book is not enough. You have to put in a lot of practice to become good at it. I personally like this take, because it’s true that the only way to become good at programming is by doing a lot of programming, even if we don’t all agree on the details on what “good” means.
# A note on terminology
I am using the terms "good code" and "bad code" to describe what I believe to be good or bad code. Uncle Bob uses the term "clean code" to describe a pathway to achieving "good code" from his perspective.
# References
[[Clean Code - A Handbook of Agile Software Craftmanship - Robert C. Martin.pdf]]