Clean Code: a Handbook of Agile Software Craftsmanship

Writing code that is easy to read and easy to test is difficult to achieve. The fact that poorly written code can function often leads to coding practices that are effective but not necessarily efficient. Too often, many programmers fresh out of school write code in the manner that was effective for passing their courses, but contains a lot of spaghetti.

Experience and continual learning will eventually improve coding skills, but if you want to improve quickly I recommend a book that helped me raise my coding skill to a new level. Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin is an excellent resource on the art of writing easily readable code. The book challenges the reader to think about what’s right about code, and what’s wrong with it.

Readers will learn:

  • How to tell the difference between good and bad code
  • How to write good code and how to transform bad code into good code
  • How to create good names, good functions, good objects, and good classes
  • How to format code for maximum readability
  • How to implement complete error handling without obscuring code logic
  • How to unit test and practice test-driven development

What makes this book stand out from the others is that the information is presented in a manner that allows you to adapt and improve upon what you already know. Other books I’ve read introduced great methods, but required a lot of time to learn. It’s fine if you have the extra time, but most of us don’t. After reading the book I was able to start applying what I learned on a current project.

My experience

I selected a project that allowed me to slow down a bit so I could apply several of the practices outlined in the book. The important part for me was starting with small steps and repeating them. Pretty soon I found a new coding rhythm, enabling me to incorporate even more improvements. Putting what I learned into practice every day and not trying to do too much at once was key for me.

I started by writing unit tests the way they were outlined in the book. At the same time I also identified and was able to modify several code smells. Next, I modified the members of my classes so they had better names. I also moved some logic to sub-classes and made several refactoring modifications. The first results weren’t ground breaking, but they were a big step in improving my ability to write consistently clean and testable code.

I especially liked that I didn’t need to spend time creating practice applications. I was able to take the project I was working on and make it better! If you follow my example, you can improve your coding ability and have fun doing it while saving yourself a lot of frustration. The important thing is don’t expect to achieve super results the first time. It’s a process that requires practice, but because it builds on what you already know, it doesn’t require extra time. I just took small steps like the book suggested and I was able to progress quickly.

Threading guide

Besides writing clean code, the author also introduces testing problems. There is a very good section about testing threaded code, the pitfalls, and how to deal with them. Given my level of understanding of the subject, I consider this one of the best essays on threading I have read. It is not a hard-to-read technical piece, but beginners may need to research some of the definitions to understand it thoroughly.

My special thanks to Robert C. Martin

I want to give special thanks to Robert C. Martin for writing this book. Many books on coding have a steep learning curve before you start getting results, and others point you in the direction to go then leave you alone on the path not knowing what to do.

Clean Code gives you a lot more than technique. It also talks about mental tools to use to really sharpen your skills. Clean Code is top-level book. Get a copy and read it. You will never regret your decision. I promise.

Gunnar Peipman
Gunnar is the CEO of Developers Team Ltd, an Estonian software development company. He has been using Microsoft platforms and technologies since primary school. The maniacal interest and enthusiasm of developing systems and playing with bleeding edge technologies is still with him. His career working with .NET and related technologies started in 2003. Gunnar specializes in ASP.NET web applications, SharePoint and SmartCard technologies. To contact Gunnar, email him at: gunnar@developers-team.com.

The Related Post

This is part 2 of a 2-part article series; part 1 was featured in the September 2020 issue of the LogiGear Magazine, and you can check it out here. Part 1 discussed the mindset required for Agile, as well as explored the various quadrants of the Agile Testing Quadrants model. Part 2 will delve into ...
LogiGear Magazine – November 2010
Agile methods were developed as a response to the issues that waterfall and V-model methodologies had with defining requirements and delivering a product that turned out to be not what the end user actually wanted and needed. From www.agiletesting.com.au A software tester’s role in traditional software development methodology, a.k.a waterfall & the V-model can be ...
Agile stresses instant and easy communication and is built on teams working efficiently together. This necessitates an open work space environment. A characteristic of an effective team is a high level of collaboration, making the physical work environment an important factor. Cubicles should be eliminated in favor of an open work space in an effort ...
To begin this article, it would be a good idea to, remember this key point: Agile Manifesto Value #1 Individuals and interactions over processes and tools Tools work at the service of people. People, particularly intelligent people, can never be slaves to tools. People talking to each other, working together and solving problems is much ...
Agile is a philosophy focused on delivering constant value to customers incrementally and frequently, based on communication and feedback. These two ingredients are vital to a successful Agile recipe. Agile is no longer a buzzword or an unknown territory in the industry. Agile has progressed leaps and bounds the last few years and has matured to ...
Video narrated by MICHAEL HACKETT – Certified ScrumMaster This is Part Three of a Four Part Video on “New Roles for Traditional Testers in Agile Development” Michael shares his thoughts on “A Primer – New Roles for Traditional Testers in Agile”   LogiGear Corporation  LogiGear Corporation LogiGear Corporation provides global solutions for software testing, and ...
SKILLS Agile teams need training! One of the missing links in the implementation of Agile development methods is the lack of training for teams. I noticed in our recent survey on Agile that only 47% of the respondents answered “Yes” that they had been trained in the Agile development process, with over half responding “No.” ...
Testing in Agile Part 1 – INTRODUCTION TO AGILE In case you missed the first part of the series in our last magazine issue from Michael Hackett, Agile’s impact on software development teams is huge. For test teams it can be even more pronounced — and good, especially if your existing projects have been problematic.
“Agile is to software development what poetry is to literature. It is very difficult to do well, very easy to do poorly, and most people don’t understand why a good poem is good and a bad poem isn’t…” – from the web
Armed with the right tool or set of tools, a development team can incorporate ALM into its Agile process and start reaping the benefits of Agile ALM. As the software development industry matures, it is devising methods for ushering products from inception to completion—a process that has come to be known by the buzzword ALM ...
Keeping an eye on the horizon in the testing world is an important part of staying in the game. Hans is no stranger to looking to the future with eyes wide and ears open. His expertise is what makes Hans valuable at the STARWEST Expo, which he recently delivered two talks to.

Leave a Reply

Your email address will not be published.

Stay in the loop with the lastest
software testing news

Subscribe