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
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
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

Author of The Agile Warrior, Rasmusson answers questions from LogiGear’s testing staff about test automation in agile projects.
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 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 ...
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.” ...
Application development and delivery teams are under constant pressure to release quality features as quickly as possible. CIOs rate delivering applications faster, with higher quality and with strong control on application development as their key priorities. What’s more, supporting this type of agile environment is particularly complex to IT teams that are also tasked with supporting ...
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 ...
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 ...
The sprint is almost over; the burn-down chart has not budged. The test team sits around waiting. They hear about all kinds of issues, obstacles and impediments at the daily stand-up but there is no code to test. Closing in on the demo and sprint review… then at Wednesday’s stand up: the heroes arrive and ...
Agile is here to stay. Once the radical alternative to Waterfall development methods, these legacy methodologies are being disrupted and replaced by Agile practices that improve time-to-market, reduce development costs, and produce higher quality software that better meets customer expectations. As the world demands more software, development teams – from scrappy startups to big corporations ...
In the decade since the Agile Manifesto, the movement has encouraged a number of best practices like test-driven development, user-centered design, iterative development, clean code, refactoring, continuous integration, and—arguably—cloud computing. I’m a card-carrying Agile zealot, and to me its benefits are unarguable. Is your IT organization ready to be Agile, seriously? Score yourself on these ...
Video narrated by MICHAEL HACKETT – Certified ScrumMaster This is Part Four 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 ...
“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

Leave a Reply

Your email address will not be published. Required fields are marked *

Stay in the loop with the lastest
software testing news

Subscribe