TechBookReport logo



Keywords: Perl, software maintenance, refactoring, legacy code

Title: Perl Medic - Transforming Legacy Code

Author: Peter J. Scott

Publisher: Addison Weslry

ISBN: 0201795264

Media: Book

Level: Intermediate, advanced

Verdict: Highly recommended

In the real-world software maintenance is, in the vast majority of cases, an absolute pain in the butt. Poor documentation, commented code that's more fiction than non-fiction, obscure data structures. If the code has been around you can expect multiple coding standards, different styles and special cases galore. Bitter, twisted? Yep, that's what happens when you inherit legacy code?

In 'Perl Medic' Peter J. Scott takes the reader by the hand and leads him or her through the software maintenance maze. It's good stuff, that's for sure, and there's a lot here for even the most experienced coder to learn. The aims of the book are two-fold. Firstly, and most obviously, the book details a set of effective and useful techniques for maintaining legacy code. Secondly, and perhaps just as importantly, Scott expounds on programming good practice to write code that is easy to navigate, easy to understand and easy to maintain. The latter should not be seen as a purely selfless task, there are times when that horrible code you have to maintain is something you knocked up a couple of years (or more) ago.

Aside from the obvious advice - such as focusing on warnings and strictness - the practices described by Scott fit pretty much into what might be called agile development techniques popularised by the object oriented programming community. These include test-driven design, refactoring, code re-use and so on. Martin Fowler's work on refactoring is mentioned approvingly by Scott more than once. The step-by-step approach adopted by Scott fits in perfectly with the iterative test-build-test approach that is essential to XP, Scrum and other agile methodologies.

The practical approach extends to looking at previous versions of Perl and how code written in version x can be moved to version y. It includes details of CPAN and how it an essential resource when transforming old code (because you can bet your life that somebody else has got code that you can slot into place after excising some of the code that you have got to maintain). There's good advice in every chapter and there's none of the padding that seems so popular in techie books.

The book works not just because of the sound advice but also because the author writes in an engaging, interesting and convincing way. It's not just that he knows one end of a Perl script from another, it's not even the complete worked example that rounds the book off, it's more that he talks to us as fellow programmers. It feels like he's passing on the benefit of hard-won experience rather than handing on tablets of wisdom from on high.

The TechBookReport verdict: highly recommended.


Hit the 'back' key in your browser to return to subject index page

Return to home page