The only valid measurement of code quality: WTFs / minute.
As Uncle Bob wrote:
It was the bad code that brought the company down.
LeBlanc's law:
Later equals never.
The total cost of owning a mess:
As the mess builds, the productivity of the team continues to decrease,
asymptotically approaching to zero.
The grand redesign in the sky:
As the productivity becomes zero, the team wants a redesign.
It is the programmer's job to defend the code with equal passion as
managers obsess about the schedule.
Grady Booch:
Clean code is simple and direct. Clean code reads like a well-written prose. Clean code never obscures the designer's intent but rather is full of crisp abstractions and straightforward lines of control.
Dave Thomas:
Clean code can be read, and enhanced by a developer other than its original author.
Michael Feathers:
Clean code is code left by someone who cares deeply about the craft.
Ron Jeffries:
- Runs all the tests
- Contains no duplication
- Expresses all the design ideas that are in the system
- Minimizes the number of entities such as classes, methods, functions..
Ward Cunningham:
You know you are working on clean code when each routine you read turns out to be pretty much what you expected.
You can call it beautiful code when the code also makes it look like the language was made for the problem.
It is not the language that makes programs appear simple. It is the programmer that make the language appear simple!
The ratio of time spent reading vs. writing is well over 10:1. We are constantly reading old code as part of the effort to write new code, so making it easy to read makes it easier to write.