Book ReviewWorking Effectively With Legacy Code

time to read 2 min | 303 words

Working Effectively with Legacy Code is a book that should be a mandatory reading for anyone who is interested in coding for a living. I don't deal with many legacy systems at the present (except for NQA, of course :-) ) and still this book has been a fountain of knowledge about techniques, tips and tricks.

This is not a book about pretty code, it's a book about ugly code and all the myrad ways you can abuse design pricipals and good coding practices. What it does is show a set to systematically take a legacy code* and break down the dependencies so you can write tests for the code. The moment you've tests, you can move forward. Until you've tests, you're in a position where all you can do is "Edit & Pray" or... you can write tests.

I've had recent experiance with developing applications in a TDD from the start (Rhino Mocks) and converting a legacy application to TDD (NQA). I can't rave enough about how much easier it is to make a change in Rhino Mocks because of those tests. When I adapted Rhino Mocks to run on .Net 2.0 I'd broken just about every part of the application because I didn't consider what the change from Hashtable to Dictionary<T> would do when there is no item in the dictionary. Because I'd tests, it was literaly the work of a minute to find the problem and fix it.

One thing to note about this book, it took me over two months to read it. Like Xp Explained 2nd Ed. I just can't seem to read it for any length of time without starting to feel a sudden need to code something. Very productive for my projects, less so for my reading backlog.

* Legacy Code == Code without tests.

More posts in "Book Review" series:

  1. (05 Nov 2009) The Wheel of Time – The Gathering Storm
  2. (11 Aug 2009) Yellow Eyes
  3. (24 Jul 2009) Watch on the Rhine
  4. (23 Jul 2009) By Heresies Distressed
  5. (23 Jul 2008) By Schism Rent Asunder
  6. (04 Oct 2007) Making Money
  7. (30 Sep 2007) Empire of Ivory
  8. (08 Sep 2007) Empire Of Man
  9. (01 Sep 2007) March Upcountry
  10. (21 Feb 2007) Programming WCF Services
  11. (09 Feb 2007) Windows Developer Power Tools
  12. (25 Sep 2006) Old Man's War
  13. (03 Sep 2006) His Majesty's Dragon / Throne of Jade / Black Powder War
  14. (30 Aug 2006) Applying Domain-Driven Design and Patterns
  15. (18 Aug 2006) Dzur
  16. (15 Aug 2006) When Darkness Falls
  17. (22 Apr 2006) Data Binding with Windows Forms 2.0
  18. (17 Oct 2005) Knife Of Dreams
  19. (28 Aug 2005) Working Effectively With Legacy Code
  20. (25 Jul 2005) Harry Potter and the Half-Blood Prince
  21. (14 Jul 2005) Sword of Ice
  22. (14 Jul 2005) Vows & Honor Trilogy
  23. (14 Jul 2005) The Mage Storms Trilogy
  24. (14 Jul 2005) Winds of Change
  25. (10 Jul 2005) Winds of Change
  26. (09 Jul 2005) Winds Of Fate
  27. (08 Jul 2005) Burning Water
  28. (08 Jul 2005) By The Sword
  29. (06 Jun 2005) Developer To Designer
  30. (05 Jun 2005) The Last Herald Mage
  31. (01 Jun 2005) Arrow's Fall
  32. (01 Jun 2005) Arrow's Flight
  33. (27 Apr 2005) Domain Driven Desing
  34. (01 Apr 2005) Exile's Valor
  35. (18 Jan 2005) Alta
  36. (16 Jan 2005) Coding Slave
  37. (13 Jan 2005) Hibernate In Action
  38. (25 Oct 2004) In Search of Stupidity