entries friends calendar user info My Website Previous Previous Next Next
Anthony Bailey's blog - Review: Clean Code
anthonybailey
[info]anthonybailey
Add to Memories
Tell a Friend
Review: Clean Code
book cover Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin

I wouldn't usually have cared to read yet another book on the generics of good programming practice. But this one was by Bob Martin, "Uncle" of the first family of thoughtful contemporary coding, and whose blog is high on my roll.

The book claims to be unusually hard work due to the substantial amount of code it contains. I disagree - you certainly want to dive deep into the examples, but I've read plenty of texts containing more code and less value. (Although, for a book that encourages reading code, and that argues for the retirement of outdated formatting conventions, I am frankly mystified by the fixed-width, unhighlighted, vanishingly thin font used to present the examples: there might as well be tractor holes down both sides of the print-out.)

Martin makes the pragmatic simplifying choice of presenting everything in Java. That's fine; apart from some concurrency specifics, most of what is promoted will slip easily back and forth to e.g. C++ and Ruby - and if you can make Java pleasant to read, you've earned my respect.

After an introduction featuring great abstract definitions of cleanliness from the near-godly, we get twelve solid chapters of concrete advice. An account of best practice should not be surprising to a decent practitioner - and I found much of Clean Code to be a reassuring mix of the obvious ("oh, I already know that") and the nicely crystallized ("oh, that's what I already know".) TDD, culling comments, careful naming, ultra-DRY, breaking dependencies, small methods, yada yada yada.

There's also sufficient challenge ("oh, you're going to push it that far?") and controversy ("er, wtf? maybe...") to keep it interesting. Uncle Bob is illuminatingly obsessive about the law of Demeter and the single responsibility and open/closed principles. He particularly surprised me with his enthusiasm for keeping plain old data structures around within the object-oriented world.

But the three large case studies that close the book are the real gold here - the summary list of smells drawn from them is no substitute for their glorious, odorous detail. They are very engaging: despite their final shininess, I bet you too will want to polish them a little further.

Recommended.

Tags: ,

about this journal
License:Public Domain Dedication
Feed:RSS feed
Contact details
Blog - permalink
Tumblelog - Anthony uncut
My views, not Amazon's
tags
page summary