Clean Code

“Clean code” describes source code that is written first and foremost to be read and changed by people. The emphasis falls on clarity: descriptive names, small and focused functions, the absence of needless duplication, and tests that let the code be changed with confidence. The premise is that programs are read far more often than they are written, so readability is a primary virtue rather than a luxury.

The phrase is closely associated with Robert C. Martin, whose Clean Code Blog has gathered his writing on software craftsmanship and design principles since 2011, and whose 2008 book “Clean Code” gave the idea its popular name. His broader argument is that structure and readability are first-class engineering concerns, on par with correctness and performance.

In practice clean code is supported by the same principles Martin promotes elsewhere. His Single Responsibility Principle post argues that “each software module should have one and only one reason to change,” framing well-factored modules as the foundation of code that stays understandable as it grows.

Clean code is less a fixed checklist than a discipline: many small, mutually reinforcing habits - good names, short functions, removed duplication, and continuous refactoring - that together keep a codebase legible and cheap to change over time.