Tuesday, November 13, 2007

Book Review: Implementation Patterns

Implementation Patterns by Kent Beck.  Published by Addison Wesley, ISBN 0321413091.

This book is a wonderful, concise book on writing code that others can understand.  I love Beck’s premise in his intro: “Actually, this book is based on a rather fragile premise: that good code matters.  I have seen too much ugly code make too much money…”  A pretty amazing blurb, but Beck goes on throughout the book to prove why you should care about good code and how you can do a better job of writing non-ugly code that others can more easily grok out.

The book’s chapters run a short gamut of great topics from programming theory to frameworks.  One of the more intestesting bits I found was his discussion on symmetry, the idea that methods and classes should be well balanced.  Methods such as “Add()” should be balanced by “Remove()”, and that ideas in sections of code should be expressed in the same style, i.e.

void process() {

input();

count++;

output();

}

 where input() and output() are intentions while count++ is an implementation.  Esoteric, but the flow is much cleaner and clearer when you read the snippet below instead.

void process() {

input();

tally();

output();

}

I like the discussion in this book is on good naming styles, something I’m passionate about — and am still not happy with my own practices in that area.  There’s also great text on state, behavior, and different ways to look at methods.

This book’s an easy read.  Beck’s writing style is absolutely approachable, and the book’s quite short at 155 or so pages.

Beck’s book helps me to better consider how to rephrase my code so its intent is clearer and it’s more maintainable by myself and others on my teams.  Highly recommended.

No comments:

Subscribe (RSS)

The Leadership Journey