What Is Clean Code? – In Quotes
Join the DZone community and get the full member experience.Join For Free
what is actually good, clean code? why does it matter?
( emphasis is mine.)
bjarne stroustrup, inventor of c++:
i like my code to be elegant and efficient. the logic should be straightforward and make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy , and performance close to optimal so as not to tempt people to make the code messy with unprincipled optimizations. clean code does one thing well.
grady booch, author of object-oriented analysis and design with applications:
clean code is simple and direct. clean code reads like well-written prose. clean code never obscures the designers’ intent but rather is full of crisp abstractions and straightforward lines of control.
“big” dave thomas, founder of oti and godfather of the eclipse strategy:
clean code can be read, and enhanced by a developer other than its original author . it has unit and acceptance tests. it has meaningful names. it provides one way rather than many ways for doing one thing. it has minimal dependencies, which are explicitly defined, and provides a clear and minimal api. code should be literate since, depending on the language, not all necessary information can be expressed clearly in code alone.
michael feathers, author of working effectively with legacy code:
i could list all of the qualities that i notice in clean code, but there is one overarching quality that leads to all of them. clean code always looks like it was written by someone who cares. there is nothing obvious that you can do to make it better . all of those things were thought about by the code’s author, and if you try to imagine improvements, you are led back to where you are, sitting in appreciation of the code someone left for you—code written by someone who cared deeply about the craft.
ward cunningham, inventor of wiki and fit, co-inventor of extreme programming. the force behind design patterns. smalltalk and oo thought leader. the godfather of all those who care about code.
you know you are working with 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.
clean code is
- easily accessible to others (straightforward, clear intent, good abstractions, no surprises, good names) – this is absolutely the most mentioned point
- is made for the real-world, i.e. has a clear error-handling strategy (my current project has been burnt a lot by the lack of this so my emphasis is little subjective )
- the author clearly cares for the software and other developers (which implies both readability and maintainability)
- is minimal (does one thing, has minimal dependencies)
- is good at what it does
Published at DZone with permission of Jakub Holý, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.