Clean Code#
Clean code is a collection of best practices that help you write code other software developers can understand and maintain.
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
– Martin Fowler
Why should we care about clean code?#
Clean code is easier to read.
Clean code is easier to maintain.
Clean code is easier to debug.
Clean code is easier to test.
Clean code is easier to extend.
Clean code is easier to reuse.
Clean code is easier to understand.
Clean code is easier to document.
Clean code is easier to review.
Clean code is easier to refactor.
Clean code is easier to write.
Clean code is easier to learn.
Clean code is easier to teach.
Clean code is easier to use.
Clean code is easier to change.
Clean code is easier to improve.
Clean code is easier to fix.
Clean code is easier to optimize.
Clean code is cheaper to maintain.
…
Origin of the term “clean code”.#
Clean code is a term coined by Robert C. Martin (Uncle Bob) in his book “Clean Code: A Handbook of Agile Software Craftsmanship”. He coined it but the practices he describes were not new. They are just a collection of best practices that have been around for a long time. The term “clean code” is just a way to describe these practices.