Infovark Underground

  • news
    • infoblog
    • underground
  • product
  • download
  • buy
  • support
  • about
    • ← Review: The Pragmatic Programmer
    • The Curse of the Singleton →

    Review: Working Effectively with Legacy Code

    07 Nov 2008 by Dean in Books, Programming, Testing / 1 Comment

    Working Effectively with Legacy Code

    I know what you’re thinking: “Infovark’s been around for barely a year! Surely you guys aren’t having to deal with legacy code already?” If you accept Michael Feather’s expansive definition of legacy code — code without unit tests — then yes, despite our best efforts, we have lots of legacy code.

    But even if you don’t buy that definition, and even if you’re working on a completely greenfield application, chances are you’ll have a lot of code in your project that isn’t fully understood. Or perhaps isn’t fully understood by all members of the team. And it’s in dealing with this issue that Working Effectively with Legacy Code really shines.

    What happens when you need to change code that isn’t fully understood? Are you making it better or worse? The author says that you can’t know the answer to this question without tests in place. Having documentation is nice, but unit testing provides measurable output.

    The brass tacks

    Unlike many programming books, this one is organized in a Q&A format. Once past the introduction — which you can skip if you already understand the importance of refactoring and test-driven development — you’ll find the chapters organized by topic. Here’s a sample of a few chapter headings:

    • It Takes Forever to Make a Change
    • I Can’t Run This Method in a Test Harness
    • Dependencies on Libraries are Killing Me
    • I Don’t Understand the Code Well Enough to Change It
    • This Class is Too Big and I Don’t Want It to Get Any Bigger

    This is a great way to organize a highly technical book. Each chapter has a specific purpose. The author then spends the chapter discussing the ways you can get out of the jam and weighing the pros and cons of each.

    You’ll find in-depth examples of each of the techniques used, but be prepared to shift between languages. To get the most out of the book, you’ll need to be comfortable scanning unfamiliar syntax.

    As a bonus, the book contains an index of common refactoring patterns. Certain patterns make appearances in more than one chapter, and the index provides another place for the author to work through some real-world examples.

    All in all, this is a practical field manual for a set of problems that occur too often out in the wild. I highly recommend it.

    Related posts

    1. Review: Code
    2. Review: Brownfield Application Development in .NET
    3. Review: The Pragmatic Programmer
    4. The Curse of the Singleton
    5. Review: Restful Web Services
    • Tweet
    • Tags:
    • Programming
    • refactoring
    • Review

    1 Comment

    • The Curse of the Singleton « Infovark Underground

      [...] Programmer (my review of The Pragmatic Programmer) and Working Effectively with Legacy Code (my review of Legacy Code). I remember telling Gordon I’d tackle the problem over the [...]

      Leave a Comment

      Posting your comment...

      Subscribe to these comments via email

      • Categories

        • .NET (41)
        • AJAX (3)
        • Books (7)
        • HTML (9)
        • Infovark (8)
        • Programming (48)
        • REST (11)
        • SQL (3)
        • Testing (3)
        • Tools (13)
        • UI (3)
        • WCF (11)
        • Web Services (8)
        • WPF (4)
        • XML (4)
      • Archives

      • Get future articles


         

      • Blogroll

        • Ajaxian
        • Anne Van Kesteren
        • Brain.Save()
        • Coding Horror
        • Eric Sink
        • Joel Spolsky
        • John Resig
        • Mark Pilgrim
        • Raymond Chen
        • Scott Hansleman
        • Secret Geek
        • Steve Yegge
        • The Daily WTF
        • The Database Programmer
      • Meta

        • Log in
        • Entries RSS
        • Comments RSS
        • WordPress.org
    • Site map

      • News
      • Product
      • Download
      • Buy
      • Support
      • About
    • Recent Posts

      • Review: Brownfield Application Development in .NET
      • Using Modal Dialogs with a Splash Screen in WPF
      • Highlighting query terms in a WPF TextBlock
      • Getting XAML Hyperlink text to wrap
      • How to format the XAML Hyperlink NavigateUri
    • Twitter

      Copyright 2011 Infovark, Inc. All rights reserved.