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.
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.
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
Post a Comment