Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Clean code (1st ed.): a handbook of agile software craftsmanship
Martin R., Prentice Hall PTR, Upper Saddle River, NJ, 2009. 464 pp. Type: Book (9780132350884)
Date Reviewed: May 7 2009

If you have been involved in developing on top of legacy code, you have probably felt the pain of working with poorly designed code and a lack of documentation. This situation is simply a source of frustration and a definite cause of errors and project delays. Legacy code is not the only problem; our own code, when badly written, may lead to the same frustration, when used by others or even when extended or customized by the original developer.

Writing elegant and maintainable code is, for many developers, an art, rather than a skill we can learn. This is probably due to the lack of training on the subject, as part of the developer’s curriculum. However, we must all agree that some developers are more gifted than others in writing clean code, just by looking at the way they name variables and structure methods. Experience is definitely the best way to acquire this skill. Nevertheless, a more productive way is to gather all the tips and tricks in a pedagogical guide, so that budding developers can increase their experience with these best practices in mind. This is what this handbook is all about.

Martin provides a synthesis of his experience in software development in the form of a very pedagogical manual for building clean code. The book is based on the Java language and is divided into 17 chapters.

Chapter 1 is a general introduction to the book. The introduction is followed by specific advice on how to give meaningful names to variables and functions. Next is a description of best practices in documenting code with comments. The book also discusses code formatting, the only way to improve code readability. Three chapters list guidelines on organizing bigger chunks of code, focusing on data structures, error handling, and the use of third-party code, respectively. One chapter gathers best practices in writing unit tests. The book also discusses class organization and coarse-grained code, including systems and how to build them in a way that decreases complexity, making them easier to maintain. Chapter 12 provides a compact report that depicts simple design rules; these include continuous code refactoring and avoiding duplication. This is followed by an example case study that goes through a refinement process, in order to obtain cleaner code. Another case study is presented to expose bad code design. The final chapter gathers all code heuristics that expose code “smells” and shows how to correct them.

While reading the book, I particularly enjoyed the ironic and confident style of the author. His extensive experience as a software developer is definitely the reason behind this confidence. The information is concise, clear, and exemplified with code samples. I also liked the illustrations at the beginning of each chapter, as they gracefully fill out the chapter material; they provide a summarized picture of the story that follows.

The book is perfectly suitable for beginners with an elementary knowledge of the Java language. Most of the material is also applicable to any other object-oriented language.

I highly recommend the book as a companion to any course on programming languages or software engineering, and even as a reference for more experienced developers.

Reviewer:  Ghita Kouadri Review #: CR136794 (1003-0222)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
General (D.2.0 )
 
 
Miscellaneous (D.2.m )
 
 
Software Management (K.6.3 )
 
Would you recommend this review?
yes
no
Other reviews under "General": Date
Development of distributed software
Shatz S. (ed), Macmillan Publishing Co., Inc., Indianapolis, IN, 1993. Type: Book (9780024096111)
Aug 1 1994
Fundamentals of software engineering
Ghezzi C., Jazayeri M., Mandrioli D., Prentice-Hall, Inc., Upper Saddle River, NJ, 1991. Type: Book (013820432)
Jul 1 1992
Software engineering
Sodhi J., TAB Books, Blue Ridge Summit, PA, 1991. Type: Book (9780830633425)
Feb 1 1992
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy