Summary of — Clean Code by Robert C Martin —Part 1: Overview


First of all, I want to thank this marvelous author who did countless research and interviews to write this important book. It has definitely changed my way of thinking and programming. If you really want to understand fully about clean code, I recommend you to buy this book from Amazon.

This series of articles is intended to give a high-level idea to our fellow developer community on how together we can write a better code for the next generation.

Why Clean Code?

I personally have felt the need for good code when debugging what could have been done in 5 mins, instead took 3 hours of my crucial time.

Programmers face a problem of basic values. All developers with more than a few years of experience know that previous messes slow them down. And yet all developers feel the pressure to make messes in order to meet deadlines. In short, they don’t take the time to go fast! True professionals know that the second part of the problem is wrong. You will not make the deadline by making a mess. Indeed the mess will slow you down instantly and will force you to miss the deadline. The only way to go fast is to keep the code as clean as possible at all times.

What is clean code?

I like my code to be elegant and efficient. The logic should be straightforward to 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.
~ Bjarne Stroustrup, Inventor of C++

Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control.
~ Grady Booch, author of Object Oriented Analysis and Design with Applications

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’re led back to where you are, sitting in appreciation of the code someone left for you — code left by someone who cares deeply about the craft.
~ Michael Feathers, author of Working Effectively with Legacy Code

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.
~ Ward Cunningham, inventor of Wiki

The art of writing a clean code

Writing clean code requires the disciplined use of countless little techniques applied through a painstakingly acquired sense of “cleanliness”.

Please read my next article — Summary of — Clean Code by Robert C Martin — Part 2: Meaningful Names — to understand how to choose meaningful names in your code.

Programming Nerd

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store