|
Robert ("Uncle Bob") Martin and the folks at ObjectMentor have written a new book that should be required reading for all programmers! When it comes to writing clear and maintainable code, cleanliness is indeed next to godliness, and we should all follow the Boy Scouts' Rule whenever we write or modify any piece of code: leave the place cleaner than when you found it!Robert C. Martin is one of the giants of object-oriented design, and a founding father of the agile manifesto and of agile software development. More recently, he helped kickstart the software craftsmanship movement, which gained much attention from his keynote at Agile2008 and subsequent talks on craftsmanship and ethics. Mr. Martin also has a bold reputation for being ever so pragmatic, and to the point, with a flair and passion that is ever present throughout the book, as exemplified by gems such as the following from Clean Code Tip of the Week #1 (available online from the "Extras" tab of the InformIT site for the book): "Duplicate code is the root of all evil in software design. When a system is littered with many snippets of identical, or nearly identical code, it is indicative of sloppiness, carelessness, and sheer unprofessionalism. It is the guilt-edged responsibility of all software developers to root out and eliminate duplication whenever they find it." This is vintage Uncle Bob -- he pulls no punches! And he also believes that books about programming should contain lots of real world coding examples. The book is almost littered with working code examples, including an appendix of some 60 or so pages of code listings.
"This book will tell you, in hideous detail, what I and my compatriots think about clean code. ... We will present these opinions as absolutes, and we will not apologize for our stridence. To us, at this point in our careers, they are absolutes. They are our school of thought about clean code. ... But don't make the mistake of thinking that we are somehow "right" in any absolute sense. ... Indeed, many of the recommendations in this book are controversial. You will probably not agree with all of them. You might violently disagree with some of them. That's fine. We can't claim final authority. On the other hand, the recommendations in this book are things that we have thought long and hard about. We have learned them through decades of experience and repeated trial and error. So whether you agree or disagree, it would be a shame if you did not see, and respect, our point of view." As the back cover notes, Clean Code is 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. The third part a single chapter containing a list of heuristics and "smells" gathered while creating the case studies. Readers should expect to learn:
The early chapters cover naming conventions, functions, comments, formatting, objects & data-structures, and error-handling. Middle chapters cover boundaries, unit-testing, and classes. After that it gets a bit more advanced and we encounter topics like: systems and scaling-up, emergence, concurrency and successive refinement. These cover some of the basic principles of design such as the single-responsibility principle, the DRY principle, the Law of Demeter, as well as many common design patterns. Along the way we also learn some heuristics and corollaries to these principles, as well as: · The FIRST Rule of Clean Tests · The Three Laws of TDD · The Four Rules of Simple Code As an added bonus, we also learn about aspects, DSLs, dependency injection, active records, and numerous testing automation tools. But perhaps the most important rule of all that we learn is The Boy Scout Rule, for it personifies the professional work-ethic that writing Clean Code is all about: "It's not enough to write the code well. The code has to be kept clean over time. We've all seen code rot and degrade as time passes. So we must take an active role in preventing this degradation. The Boy Scouts of America have a simple rule that we can apply to our profession. * Leave the campground cleaner than you found it. If we all checked-in our code a little cleaner than when we checked it out, the code simply could not rot. The cleanup doesn't have to be something big. Change one variable name for the better, break up one function that's a little too large, eliminate one small bit of duplication, clean up one composite if statement. Can you imagine working on a project where the code simply got better as time passed? Do you believe that any other option is professional? Indeed, isn't continuous improvement an intrinsic part of professionalism?" If you are at all serious about programming, then as soon as you finish reading this review you should get your hands on Clean Code as fast as you can! Get it. Read it. Learn it. Then live it! About the Reviewer
Set as favorite
Bookmark
Email this
Hits: 3422 Trackback(0)Comments (0)
|
| Last Updated on Wednesday, 15 April 2009 11:08 |
Agile Marketplace - Announcements and Special Offers
Upcoming Webcasts
Sponsored by Urbancode - On Demand
Mastering Complex Application Deployment
Sponsored by CollabNet - Wednesday, August 24, 2011
Closing the Agile Loop: Continuous Integration, Continuous Information
ScrumWorks Pro – The World’s Best Agile Project Management Tool
Simply put, CollabNet’s ScrumWorks Pro is the best Agile project management solution on the market, bar none. More than 150,000 Agile professionals rely on the power and simplicity of ScrumWorks every day. But don’t take our word for it – try it yourself for free. CollabNet is now providing the first 10 users of ScrumWorks Pro at no charge!
Download ScrumWorks Pro today!
The Business Case for ALM Transformation
Are legacy systems holding your company back? Breakthrough these technical constraints with an open and scalable environment that meets your unique business need to transform. There is no reason to be locked into an obsolete platform. The output of a number of recent transitions from legacy systems, this is practical white paper shares lessons learned and illustrates how guidance and enablement can pave the way for change.
Download this Whitepaper



Robert ("Uncle Bob") Martin and the folks at 

