Clean Code: A Handbook of Agile Software Craftsmanship and over one million other books are available for Amazon Kindle. Learn more
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See all 2 images
Sell yours for a Gift Card
We'll buy it for $23.69
Learn More
Trade in now
Have one to sell? Sell on Amazon

Clean Code: A Handbook of Agile Software Craftsmanship Paperback – August 11, 2008

ISBN-13: 978-0132350884 ISBN-10: 0132350882 Edition: 1st
Rent
$20.70
Buy new
$40.03
Used & new from other sellers Delivery options vary per offer
74 used & new from $36.15
Rent from Amazon Price New from Used from
Kindle
"Please retry"
Paperback, August 11, 2008
"Please retry"
$20.70
$40.03
$36.15 $36.99
Free%20Two-Day%20Shipping%20for%20College%20Students%20with%20Amazon%20Student


Hero Quick Promo
Save up to 90% on Textbooks
Rent textbooks, buy textbooks, or get up to 80% back when you sell us your books. Shop Now
$40.03 FREE Shipping. In Stock. Ships from and sold by Amazon.com. Gift-wrap available.

Frequently Bought Together

Clean Code: A Handbook of Agile Software Craftsmanship + The Pragmatic Programmer: From Journeyman to Master + Code Complete: A Practical Handbook of Software Construction, Second Edition
Price for all three: $106.64

Buy the selected items together

Editorial Reviews

From the Back Cover

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 withClean Code: A Handbook of Agile Software Craftsmanship. Martin 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 a 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
This book is a must for any developer, software engineer, project manager, team lead, or systems analyst with an interest in producing better code.

About the Author

Robert C. “Uncle Bob” Martin has been a software professional since 1970 and an international software consultant since 1990. He is founder and president of Object Mentor, Inc., a team of experienced consultants who mentor their clients worldwide in the fields of C++, Java, C#, Ruby, OO, Design Patterns, UML, Agile Methodologies, and eXtreme programming.
NO_CONTENT_IN_FEATURE


Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

  • Paperback: 464 pages
  • Publisher: Prentice Hall; 1 edition (August 11, 2008)
  • Language: English
  • ISBN-10: 0132350882
  • ISBN-13: 978-0132350884
  • Product Dimensions: 6.9 x 1.1 x 9.1 inches
  • Shipping Weight: 1.5 pounds (View shipping rates and policies)
  • Average Customer Review: 4.4 out of 5 stars  See all reviews (233 customer reviews)
  • Amazon Best Sellers Rank: #4,099 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

4.4 out of 5 stars

Most Helpful Customer Reviews

131 of 135 people found the following review helpful By Edelmiro Fuentes on September 23, 2008
Format: Paperback Verified Purchase
When you do code maintenance, you can really "love" or "hate" a person that you do not even know just by the code he or she has written. Messy code almost always goes hand in hand with lower productivity, lower motivation, and a higher number of bugs. In the first chapter, Robert C. Martin presents in a very instructive way, the opinion from very well-known personalities about what "clean code" is, and also suggests we apply the Boy Scout Rule (Leave the campground cleaner that you found it) to our code. The following chapters present practical advice about how to do this cleaning (or even better, how to avoid the mess in the first place).

The suggestions presented in the book (meaningful names, pertinence of comments, code formatting, etc) may sound very familiar to any experienced programmer but they are presented with such a level of detail and with very illustrative examples that it is almost impossible not to learn valuable things chapter by chapter. All the examples are in Java, but the guidelines they illustrate can be applied, in most of the cases, to other languages.

The most challenging chapter to read (but also a very valuable one) was the Refactoring of the class SerialDate (from the JCommon library). It is a real-life example and the author shows step-by-step what it takes to do refactoring. The last chapter, "Smells and Heuristics" makes a very good closure presenting in categories and in a condensed way, potential problems and suggested ways to solve/mitigate them.

I enjoyed reading this book and after finishing it, I decided to apply the Boy Scout Rule. I took a module written in a procedural language and not only managed to improve the clarity of the code, but also reduced the number of lines from more than 1,100 to 650. The next person to touch this code will certainly be happy to deal with cleaner code!
10 Comments Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
93 of 96 people found the following review helpful By Matthew R. Heusser on August 21, 2008
Format: Paperback
When most people hear the term "bad writing" they understand the term: Confusing, inconsistent, rambling, big words used incorrectly.

In fact, we have lots and lots of educational programs designed to teach grammar, composition, journalism, and fiction. Master's Degrees in the subject, even.

But for software development we seemed obsessed with "architecture" (whatever that means), process and patterns.

In this book, Bob Martin takes a specific stab at what good code looks like. He provides rules, examples, and even sample transformations.

It is not an easy book. If you are a new developer, you can invest a lot of time and energy into really absorbing the concepts and practicing them yourself. If you are more senior, you may disagree, you may struggle, you may toss the book in a corner and yell at it ...

But then you'll pick it back up again. And you will be a better developer for it.

One thing that I struggle with about the traditional CS cirricula is that so little attention is spent on maintenance, which is the vast majority of actual development time. This book presents an aesthetic and the skills to write maintainable code. If you teach software development, you'll want to use this book in your courses.

Student, Journeyman, Master, or Instructor - A book like this belongs on your bookshelf. Follow the advice in it, or have an explanation why not - either way you'll be a strong developer.

Of course, there are other books in this area. What struck me about this one is the quality of the writing; it is truly engaging and -- a little inspiring. That quality is so rare in technical books that I give this one five stars.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
56 of 56 people found the following review helpful By KW on February 24, 2011
Format: Paperback Verified Purchase
In response to the "Don't get the Kindle version" review -- the problems appear to be resolved now. It looks fine on my Kindle 3 (aside from using proportional fonts in code examples, but this isn't too bad once you get used to it). Also, as many other reviewers have pointed out, this is an excellent book. I really wish all of my colleagues, predecessors, and managers had read it. My job would be so much easier and more enjoyable if they had.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
790 of 866 people found the following review helpful By Wayne Bradney on May 22, 2009
Format: Kindle Edition Verified Purchase
[Kindle Version Review]

The one star is not a reflection of the content of the book, which is clearly a very fine treatise on coding practices, but of the fact that the Kindle version is almost impossible to read. Code samples are truncated, in a variable-width font, and have less-than and greater-than symbols missing. References in the text often refer to listings that are not closely located with that text (eg. "see Listing 4-7 on page 71" is almost impossible to find on a Kindle without single-paging).

This is a book that requires a lot of page flipping, and shouldn't be available on the Kindle unless the publisher is willing to put in some effort to address these readability issues.
37 Comments Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
33 of 35 people found the following review helpful By Jeanne Boyarsky on September 14, 2008
Format: Paperback
"Clean Code" focuses on how to write "good" code. Where "good" is defined as being easy for others to read and maintain. It's not that I disagree with the definition of "good" here. The quotes are because 'bad" code is easier to identify. Then there is "good" code and really "great" code. The code in this book is what we should aspire to write.

There are three main sections to the book. The first describes principles with examples. I liked this section best including the chapters written by other experts. The third is the actual "smells and heuristics." While they are good, they were so short they wound up being a summary.

The second section is the case studies. Martin warns up front that this will involve a lot of reading code and cross referencing. I had trouble with flipping back and forth between the chapter, rules and an appendix at the same time. So much flipping was disruptive to my train of thought - even with three bookmarks.

Martin is good about referencing other related titles such as "Implementation Patterns." If you haven't yet read "Implementation Patterns", I recommend starting with that title. It's easier reading which is helpful when newer to a topic. Also while both books are very good, I liked "Implementation Patterns" better. (see my review on that title for why)

The actual content was excellent. The book only loses a point for the logistical issues in reading it.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Recent Customer Reviews

Set up an Amazon Giveaway

Amazon Giveaway allows you to run promotional giveaways in order to create buzz, reward your audience, and attract new followers and customers. Learn more
Clean Code: A Handbook of Agile Software Craftsmanship
This item: Clean Code: A Handbook of Agile Software Craftsmanship
Price: $40.03
Ships from and sold by Amazon.com

Want to discover more products? Check out this page to see more: elements of design patterns in it