Skip to main content

Book Review : The Clean Coder

I have realized the importance of writing clean code. The benefits of writing clean and readable code is not immediately visible. It becomes obvious when adding enhancements or fixing bugs. The time taken to fix bugs or add new functionality is drastically reduced if the code is clean. It’s very easy to say this but hard to follow. Due to this, I was overjoyed when I saw the book ‘The Clean Coder’ written by Robert C. Martin, known fondly in programming world as ‘Uncle Bob’. This book is a treasure trove of his personal experiences.

Bob got the jolt of his life when he found that his Project Manager trusted and regarded Finance department as professional rather than his own team. It was due to this that he realized the need to be professional programmer.
The book contains his real life personal experiences. It gives practical advice, including dos and don’ts, to software developers to become professionals. It describes the attitudes, disciplines and actions considered necessary to be professional. Uncle Bob’s own words describe it succinctly – “So think of this book as a catalog of my own errors, a blotter of my own crimes, and a set of guidelines for you to avoid walking in my early shoes.”

After reading this book, I realized that it is necessary to be a professional developer in order to write clean code. Once you become a professional, the code that you write is automatically clean. A professional owns up the mistake when he makes one. It is a lot easier to be a non-professional since there is no need to take responsibility for anything. However, this is easier said than done.

Uncle Bob explains what every programmer who wants to be a professional not only needs to know, but also needs to follow. Here I am giving some simple practical tips from the book which can be easily implemented.
  • Touch typing – Being able to type without looking at the keys (touch typing as opposed to hunt and peck method) can increase productivity drastically. It also helps reduce achy shoulders, stiff neck and sore wrists.
  • Practice coding – All great musicians, athletes practice their skills for hundreds of hours in order to perfect them. As software programmers we rarely do that. We just work on some small aspect of the project and feel we are doing a great job. It is necessary to apply the basic theory to the problems and solve them.
  • Saying No – Slaves are not allowed to say ‘No’ but programmers as professionals should say ‘No’ and not be cowed down by irrational schedules and release dates.
  • Unnecessary meetings – Meetings are a costly affair. It is not necessary to attend every meeting. In fact it is unprofessional to go to too many meetings. Don’t attend meetings unless your participation is immediately and significantly necessary to the task in hand. This is a very practical tip and can result in huge time saving to focus on primary task – Coding.
  • Pomodoro Technique – This is a 25 minute productivity technique. It consists of 25 minute bursts during which no interruptions are entertained. The interruptions can be attended to during a 5 minute period following the 25 minute period. Using this technique, time is divided into tomato and non-tomato time. Tomato time is productive. It is within tomatoes that real work gets done. Time outside of tomatoes is either distractions, meetings, breaks, or other time that is not spent working on tasks.
  • Test Driven Development – The most powerful benefit of having TDD is the confidence to clean up messy code. One click of a button can detect whether the cleanup has caused any problems. “When programmers lose the fear of cleaning, they clean! And clean code is easier to understand, easier to change, and easier to extend.”


In conclusion, I would say that this book is an absolute must-read for programmers.

Comments

Popular posts from this blog

Experience with Eclipse IDE

Till now all my work experience has been in Microsoft technologies, MFC, COM, C#. Due to this I have always worked in Visual Studio. Visual Studio is the best IDE. I recently shifted to a group which deals with technical aspects of projects like technical audit, technical trainings, tools automation to name a few. I got a chance to do a technical audit of code written in Java. The developers used Eclipse IDE. I downloaded and installed Eclipse IDE. I fired up Eclipse and to my horror I saw that there was no command for “Open project”. There was a menu for Open File, Import etc. but no “Open Project”. I confirmed with the project development team and sure they were using Eclipse. I thought that something was amiss with my installation. I spent about 2 hours fiddling around and trying to find out a way to open an already existing project.  Finally, I decided to do a Google search. I found the blog, http://itscommonsensestupid.blogspot.in/2009/01/open-existing-project-in-ecl