Tuesday, May 4, 2010

Clean Code by Rober C. Martin (Uncle Bob)

Thanks to JongMan Koo for sharing this beautiful book. Frankly, I don’t like reading e-books but this book is really appealing and I am enjoying reading it. Most of the content of the book forced me to practice rather than just reading. Robert C. Martin has some great books related to principles of software design and patterns in his account. In this book he mainly forces on practicing the techniques of writing good code. He wrote:

“I can teach you the physics of riding a bicycle. Indeed, the classical mathematics is relatively straightforward. Gravity, friction, angular momentum, center of mass, and so forth, can be demonstrated with less than a page full of equations. Given those formulae I could prove to you that bicycle riding is practical and give you all the knowledge you needed to make it work. And you’d still fall down the first time you climbed on that bike.”

The tone of the writer is strident most of the time in this book. The style is a bit strict that attracts you a lot and you feel an emotional attachment with every word you read. He also explains how the bigger products are buried just because of nothing but bad code. He forces the reader not to write too much cluttering comments as it is difficult to maintain them with frequent changes, instead make your code self explainable. The naming conventions are beautifully explained. One sentence is constantly ticking me in this regard:

“You should name a variable using the same care with which you name a first-born child.”

“Uncle Bob” mainly explains what are the main components of a clean code in the light of various quotations made by some great scholars and practitioners in the history of computers. I haven’t read the complete book yet so I will not be able to summarize all the aspects the author covered but I assure you that some initial reading will definitely made you think about common mistakes we normally make. It is not just a theoretical book, it is for practitioners so a lot of real time examples are given in the final chapters to improve readers' capability of understanding bad practices and adapting better ones.

If you are a coder with around 1 year of experience and you have seen a couple of ups and downs in your project, this book is highly recommended.

No comments:

Post a Comment