Search  for anything...

Clean Code: A Handbook of Agile Software Craftsmanship

Based on 6,818 reviews
Condition: New
Checking for the best price...
$26.16
Save $37.83 was $63.99

Buy Now, Pay Later


As low as $6 / mo
  • – 4-month term
  • – No impact on credit to apply
  • – Instant approval decision
  • – Secure and straightforward checkout

Ready to go? Add this product to your cart and select a plan during checkout.

Payment plans are offered through our trusted finance partners Klarna, Affirm, Afterpay, Zip, Apple Pay, and Google Pay. No-credit-needed leasing options through Acima may also be available at checkout.

Learn more about financing & leasing here.

Selected Option

Free shipping on this product

30-day refund/replacement

To qualify for a full refund, items must be returned in their original, unused condition. If an item is returned in a used, damaged, or materially different state, you may be granted a partial refund.

To initiate a return, please visit our Returns Center.

View our full returns policy here.


Availability: Only 1 left in stock, order soon!
Fulfilled by PLUTO FINDS

Arrives Nov 15 – Nov 18
Order within 2 hours and 35 minutes

Available payment plans shown during checkout

Protect Your Purchase

Easy claims online, fast replacements, no fees

Checking for protection plans...

At a glance

Condition
New
Format
Paperback
Model
978-0-1323-5088-4
Dimensions
6.8 x 0.9 x 9 in
Weight
1.73 lb
Publisher
Pearson
Publication date
August 1, 2008

Description

Even bad code can function. But if code isn’t clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn’t have to be that way. Noted software expert Robert C. Martin, presents a revolutionary paradigm with Clean Code: A Handbook of Agile Software Craftsmanship. Martin, who has helped bring agile principles from a practitioner’s point of view to tens of thousands of programmers, has teamed up with his colleagues from Object Mentor to distill their best agile practice of cleaning code “on the fly” into a book that will instill within you the values of software craftsman, and make you a better programmer―but only if you work at it. What kind of work will you be doing? You’ll be reading code―lots of code. And you will be challenged to think about what’s right about that code, and what’s wrong with it. More importantly you will be challenged to reassess your professional values and your commitment to your craft. Clean Codeis divided into three parts. The first describes the principles, patterns, and practices of writing clean code. The second part consists of several case studies of increasing complexity. Each case study is an exercise in cleaning up code―of transforming a code base that has some problems into one that is sound and efficient. The third part is the payoff: a single chapter containing a list of heuristics and “smells” gathered while creating the case studies. The result is a knowledge base that describes the way we think when we write, read, and clean code. Readers will come away from this book understanding 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 “smells” and heuristics can help you identify bad codeThis book is a must for any developer, software engineer, project manager, team lead, or systems analyst with an interest in producing better code. Read more

Specs 9

Publisher Pearson
Publication date August 1, 2008
Edition 1st
Language English
Print length 464 pages
ISBN-10 4
ISBN-13 84
Item Weight 1.73 pounds

Frequently asked questions

If you place your order now, the estimated arrival date for this product is: Nov 15 – Nov 18

Yes, absolutely! You may return this product for a full refund within 30 days of receiving it.

To initiate a return, please visit our Returns Center.

View our full returns policy here.

  • Klarna Financing
  • Affirm Pay in 4
  • Affirm Financing
  • Afterpay Financing
  • Zip Pay in 4
  • Financing through Apple Pay
  • Financing through Google Pay
Leasing options through Acima may also be available during checkout.

Learn more about financing & leasing here.

Top Amazon Reviews


Excellent for the whole team
As CTO of a software company I co-founded, I'm not only looking for books that help me improve individually, but also books that the whole development team – from developers to architects – may find useful. Robert C. Martin’s Clean Code does both, and, like the good code described therein, it’s well written, clear, and easy to read. Martin includes many helpful examples and his suggestions are applicable to any programming language. Ideally, each developer takes charge of their own education and is constantly improving their skillset, an aspect that Martin covers in The Clean Coder. I view it as an important part of my job to help my team improve. To do so, I distill a lot of written material down to actionable components and provide that to my development team. Concepts from Clean Code have become very helpful guides for them. Below are a few of my favorite takeaways. The first is what Martin calls The Boy Scout Rule: “Leave the campground a little cleaner than you found it.” It’s a great concept, not only because it's simple to follow, but also because it has broad applicability and can be used on any project. Essentially, when a team member works on a piece of code, they should aim to improve it somehow by the time their task is finished. A few examples of this among many are: fixing an unclear variable name, breaking up a large function into smaller functions, or cleaning up a conditional for improved clarity. With everyone on the team doing this, the code improves over time and everyone feels responsible for the code whether they wrote it personally or not. Even if something can’t be addressed immediately, developers are encouraged to log the issues they see. Another of my favorite takeaways is the Three Laws of TDD, a concept I was able to quickly roll out to the team as a framework to follow for how TDD should be conducted on a project. This virtually ensures that all of your product code has test coverage. It also helps make most of your code SOLID (https://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29), since code that is built in this fashion is structured with SOLID concepts in mind. This is a must for effective testing. Finally, the topics of proper identifier names and commenting really resonated with me and my team. In our company, we tend to “adopt” existing codebases – projects that have already been started by other developers whose code is of widely varying quality. If we're lucky, it's structured well and demonstrates best practices and approaches in how it's constructed. Unfortunately, the code is sloppy at times and requires some TLC to get it in shape. A part of that process is understanding what the existing application does. As Clean Code correctly outlines, many comments are superfluous or even plain wrong and misleading. As a team, we don’t blindly trust the accuracy of existing comments and instead go right to the application’s code to determine what it does. This is where proper naming comes into play. With good names, the code reads like comments or as a narrative of what the application does, nullifying most needs for additional commenting. Simply put, the code comments itself. We also use refactoring tools to improve names and clean up comments as we go. Of course, by doing so, we’re also applying the Boy Scout Rule. Overall, Clean Code is a wonderful book with much useful and immediately-applicable information for developers of all levels. If you're looking for a book that will help make you a better developer, this will. ... show more
Reviewed in the United States on December 29, 2015 by Peter J. Hanson

Learning to leave the code cleaner than before
As part of our learning activities, we learn quite a few programming languages. We also learn designs, patterns, good coding practices, and many more. We don't usually spend time to learn how to write a good, readable code. The relevance of this book is enormous. Not just the programmers should read it, the education providers should also read it. In fact, the education providers should plan to include this in their curriculum associated with every programming languages. I started reading this book and finished it in almost three consecutive sittings. That way, the book is well structured, and the topics are well sequenced. The author cautioned at the beginning of the book that it is not for the armchair readers. The reader should spend adequate effort to read through the code examples, think through those, and try out some of those through self scribbling. This is indeed necessary for the coders. This is also necessary for the instructors of coding, or programming languages. I chose to skim through the examples with just enough thinking while paying attention to every detail of the English text. Such speed reading worked for me too. Such reading technique should work for all who are not into direct coding today, but was a programmer once upon a time, and spends a lot of time in conversing with the programmers nowadays. Coming back to the content of the book - this was quite informative and thought provoking. I read it fully and tried to jot down my takeaways from this book reading. I have got six of them. I learned the general rules for commenting, and summarized those in four points. I learned the general rules for code formatting, and summarized those in four points. I learned the general practice of code size - for a significant system, for a code file, for a typical function. I learned the general rules of organizing concepts and variables, and summarized those in five points. In fact, the definition of concepts was itself was a new learning for me. I learned the three laws of test driven development, rather I re-learned those once more while reading this book. Finally, I jotted down the final takeaway - leave the code cleaner than what you had started with. The book is full of good references, in fact at the end of every chapter. I tried to summarize the list of further readings, and I got another five book titles listed in my to-read list. I read it on my Kindle device, and on my desktop using Amazon Cloud Reader - the formatting was good. As coders, we all have the responsibility to leave the code cleaner than what we start with. As code reviewers, we all have the responsibility to comment on the cleanliness of the codes. As the supervisor or manager of coders, we all have the responsibility to communicate the importance of clean coding and to encourage coders towards clean coding. I will recommend to all these group of people to read this book, and practice the clean coding techniques described here. Good work indeed! ... show more
Reviewed in the United States on September 16, 2017 by Arijit Chakraborti

Top 10 Books on SW Development - A Must Read
Format: Paperback
I first met Bob Martin 15 years ago by reading his brilliantly lucid _Designing Object Oriented C++ Applications Using The Booch Method_. He was kind enough to help me sort out my own struggles with the writings of the "Three Amigos" and I've been something of a fan ever since. He followed with a number of excellent books; took the lead first on Patterns and then on Agile development; but now he has reached beyond his dedicated audience of serious software architecture geeks, with this extraordinary work on writing code well. This book ranks on any shelf that has either Code Complete by Steve McConne or Refactoring by Martin Fowler; both classics (though loyalty and enjoyment causes me to add Why Software Sucks by David Platt as belonging on that shelf as well). It is true that seasoned developers will find that they "already know" much of what is in the early portion of the book -- but my experience is that Martin has a unique ability to crystalize even common wisdom in a way that gives accepted practice new impetus and that expands my understanding of the implications of tenets I hold to but don't always fully implement. Bob Martin is known to many of us as "Uncle Bob," and with good reason; his writing is avuncular in the finest sense of being solid advice offered in good cheer and without condescension. All of that said, this is not a light weight book; while offering up the fundamental principles that separate yeoman programmers from the truly expert, he goes on to teach more (and more effectively) about test driven development in one chapter than most authors accomplish in a book. He does the same for refactoring and, I would argue, on the way he offers a brilliant introduction to Agile programming. While we're at it, let's note that the chapters on naming and on comments would serve well as a standard for any software development group and should certainly be required reading for all new developers. In short, this book is recommended without reservation to those who are not yet convinced they know all that can be known about creating great software. I own both the electronic and the hardcover version, and it was money very well spent. ... show more
Reviewed in the United States on January 24, 2010 by Jesse Liberty

The way the craft ought to be...
Format: Paperback
For the past few years I began to doubt whether my understanding of the craft was even correct anymore. So many code examples in so called expert books are untestable procedural junk I couldn't imagine what had happened. Design patterns and unit testing seem to have lost their place in the world. Servlet and JSP books have always been crap that way but now books on SOA and the like technologies are that kind of junk code. It was refreshing to find a book that emphasized the craft of coding - tests, reusability, comments, logging, decoupling, dependency injection, small methods, design patterns and so on. These aren't rocket science and they should be second nature to developers by now. I breathed a sigh of relief when I read this book. Having said that there are a few problems with the book. The author mixes programming paradigm terms too promiscuously. For example, he makes extensive use of Java code and continuously refers to "functions" and "modules". In a book about clean code that should be cleaned up. The author shows a misunderstanding of JavaBeans and really should rewrite his somewhat snarky comments. His example of a JavaBean, for example, shows a list of Strings being passed in on the constructor and the class has no setters. A JavaBean by definition must have a no-arg constructor. His example had no setters (which is OK for non-mutatable fields). If that was the intent, however, the fields should have been final. Did he mean POJO? He puts this in a chapter on DTOs wherein he talks about data structures. I don't know how many times the fact that I was using a getter/setter saved me grief when compared to using an exposed field. Changing the internal field type based on some new requirement is a good example of how it can help. While the setter may initially look like little more than a pass through method for the "OO purists" -- bah, humbug -- it can end up saving rework of a large number of classes. It allows for overloading the setter for handling new types if the requirements change. If error conditions are determined that can be detected at the setter or getter level, the fact that one has the data structure wrapped has just saved a lot of headache. The distinction made between data structure and object in this sense is specious. These JavaBeans are generally little more than protective covers for the data and do little more than set/get the data. That all appears superfluous until it bites you. The very fact that they permit further modification to meet on-going challenges during coding shows why they are used instead of hanging fields out publicly and why they are more than just data structures in drag. Perhaps he should also look at the event properties mechanism that is available for use with JavaBeans as well. There certainly are valid criticisms of JavaBeans, unfortunately the book misses them by a long way. ... show more
Reviewed in the United States on January 24, 2012 by Ranx0r0x

Mastering the Craft of Coding
Format: Paperback
What is clean code you might ask? One of the definitions that most resonated with me is that of Grady Booch, author of Object Oriented Analysis and Design with Applications: "Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer's intent but rather is full of crisp abstractions and straightforward lines of control." The main premise of the book, as stated by the author, is: "learning code is hard work. It requires more than just the knowledge of principles and patterns. You must sweat over it. You must practice it yourself, and watch yourself fail. You must watch others practice it and fail. You must see them stumble and retrace their steps. You must see them agonize over decisions and see the price they pay for making those decisions the wrong way." The book is made up of three sections: The first one outlines the "principles, patterns, and practices of writing clean code". This includes topics such as naming, functions, comments, formatting etc. The second one, includes several working examples of code cleanup using the tools from the first section. The last section, includes a number of heuristics and smells that help identify the need for cleaning code. These smells are divided by area, such as environment, names, comments etc. What sets this book apart is the applicability, practicality and breadth of the concepts discussed. The last section of the book is of particular relevance as a starting point for identifying weaknesses or deficiencies in code. These then serve as a testing ground for applying the concepts introduced in the book. What the author stresses throughout his work, is the need to continuous practice and to clean the code in an iterative manner. A recommended read for anyone involved with the software development lifecycle regardless of experience. From a critical standpoint, the choice of some of the case study code bases was at times questionable given its abstraction. This made them hard to follow at times. ... show more
Reviewed in the United States on October 13, 2012 by O. Halabieh

Excellent book
Format: Paperback
Excellent book
Reviewed in the United States on August 18, 2026 by Juanca

A must-read for all programmers and web developers
This is a fantastic tour through basic code hygiene best practices. I love Martin's blunt ranting style. He gets to the point, doesn't waste our time, and does a great job of both explaining code smells and principles at a high level, and providing enough example and code snippet content to help me connect those principles to my experience. My only complaint is that all examples are written in Java. I'm sure this is inevitable; Java is the best "lingua franca" out there, and Martin wanted to reach the largest number of coders possible with his book. But as a Ruby developer, a book on this topic written in and for Ruby would have been much much more valuable. Many Java idioms just don't translate well; Martin wants us to look at some examples and say "Ugh" while we look at other examples and say "Ahh", but as a Ruby developer it all looks like "Ugh". This makes it harder to use the book in the way the author meant me to use it. ... show more
Reviewed in the United States on October 24, 2014 by Christopher Hunt

This book teaches developing understandable software that your future self will greatly appreciate
Format: Paperback
At the consulting firm I work for, a group of us are doing a 'book study' going through this book and it has been a fantastic experience. I've been in the IT field for over a decade and doing programming for around half that time, and so many of the things I struggled with or thought were weird when I saw them in code examples (or even worse, in production code) are clearly called out as either bad practices (code smells) or as examples of applying the SOLID principles to ensure the code can be easily modified to suit changing business needs in the future. They acknowledge early that adhering to all the recommendations is hard, but without doing so you are producing suboptimal software that will be extremely hard to maintain as time goes on. They talk about many best practices like unit tests and TDD and the importance of using clearly named variables and methods and avoiding multiple levels of abstraction in a single function. I'll be referring back to this book constantly as I write new code until I internalize all the principles and become a professional coder and not just a cowboy. ... show more
Reviewed in the United States on March 31, 2019 by dragon788
Checking for best price...