Wednesday, October 14, 2015

Clean code : Getting started

Reading the foreword chapter of this book was an experience in itself. It appears that the person who has written the foreword — James is a buddy of the author whom he refers to as Bob.

He compares software development to the automobile industry. He stresses on the reality that more time/resource is spent on the maintenance than on actual production. He briefly describes some foundational principles of a methodology known as Total Productive Maintenence (TPM) that has its origins in the Japanese auto manufacturing industry. He relates these principles to coding practices. 

These principles are known as 5S:
  • Seiri or organization. Eg. Variable names
  • Seiton or tidiness. Eg. A piece of code should be where you expect to find it else it should be refactored
  • Seiso or cleaning. Eg. Remove extraneous comments and dead/commented code 
  • Seiketsu or standardization. Eg. Team-wide consistent coding styles
  • Shutsuke or discipline. Eg. Continuous self improvement 

The author acknowledges and appreciates that such philosophies as above are inculcated into the wisdom of most cultures and not just Japanese. He recognizes the importance of software development practices to lean upon these time-tested beliefs. He stresses on attention to detail, being honest to self. He mentions that the agile methodology encourages the honesty aspect by helping teams know about the current state of things on a regular basis. He ensures that the reader understands the importance of revisiting code to re-factor to make it better.