Refactoring by Martin Fowler - Developer must have

26 July, 2007

Late last year I was spending a lot of time on trains between T.O and Montreal, on one trip I picked up this book and was thoroughly engrossed - Refactoring - Martin Fowler is one of those simply must-have books on any developers bookshelf. Of all technical books I've found it to be the one that actually compels you to be a better programmer. The first chunk of the book is dedicated to whats, whys, testing etc of how you should turn your mish-mash of spaghetti code into beautiful elegant world class code, the rest of the book is dedicated to a catalog of various examples of refactorings. Each refactoring is structured with a small class diagram, theory about why you want to do it, then a detailed walk through of the steps written to get there. Well written, most of them are a doddle to understand. Even though the book uses examples in Java, they equally can apply for your Ruby, PHP, Actionscript code or whatever else tickles your fancy. If you want to change from a programmer to a code artisan, this is the book for you. If not we'll leave you alone with your unmaintainable spaghetti code. Some of the refactorings are obvious, and some the light switches on and you go 'a-ha'. Certainly if I'd have had this book from day 1 many moons ago I would've been a much happier chappy. I know using principles in the book I came away refactoring a working but messy piece of code days after reading it - the principles learned in the book made it a lot easier and quicker to do. One big personal improvement I made was towards not being afraid of breaking up functions for readability e.g. like so:
  class MyClass

    def able_to_checkout

      if ( ugly_condition_1 == a && ugly_condition_2 == c && you_get_the_picture )

         self.set_book_to_checked_out

      end

    end
(guilty as charged) to the following:
  class MyClass

    def able_to_checkout

      if ( no_books_checked_out? )

         self.set_book_to_checked_out

      end

    end

    def no_books_checked_out?

      ugly_condition_1 == a && ugly_condition_2 == c && you_get_the_picture

    end

  end
To round off the book, it's a hard cover with a little red cloth tape bookmarker. What other technical book have you seen with that in recent history ? It's been designed to stay on your shelf for a very long time - unlike some faded examples gathering cobwebs on mine. A rare timeless classic ? Quite possibly. Go out and buy it today if you haven't already. Another 10 | 10

Read More

Essential Actionscript 3 - Essential !

19 July, 2007

The great chapters.ca boat sailed into port - last week Essential Actionscript 3.0 by Colin Moock arrived on my doorstop. First impressions this is by far the biggest tech book to grace my shelves. 900+ pages worth, it dwarfs O'Reillys recently released Programming Flex 2 book. This book really does cover everything from general programming skills to the nitty gritty of E4X useage. The work that has gone into this book by Mr Moock shows. Approximately the first ~350 pages of the book is devoted to Core Actionscript & OOP principles in general, the second half Flash/Flex features such as XML, Drawing API, Security etc. Coupled with the Programming Flex 2 book I really think that's all you need for your bookshelf. My learning style is to learn by example (I skim read text - but thoroughly read code to understand) which is covered off really well, the vast majority of pages have a short code fragment or diagram to complement the text along with longer full code examples where applicable. Essential AS3 has depth to each and every topic, the ones I've read thus far anyway, going through example after example illustrating different facets of the topic - the XML chapter was particularly impressive. Too often you read a book and feel like you have to go back to the great Google Gods to discover more, whereas with this book I feel like that's all I need right there. All in all, the best tech book I've purchased (even over the famous Agile Web Development with Rails book). Value for money can't be beat, cost me about $55CAD to my doorstep - and illustrates how thankful I am living in Canada now, after being used to New Zealand book prices! It's already taken pride of place by the keyboard as I'm working on our new widget seller solution. 10|10

Read More

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.