Trade in Yours
For a £0.25 Gift Card
Trade in
Have one to sell? Sell yours here
Sorry, this item is not available in
Image not available for
Colour:
Image not available

 
Tell the Publisher!
I’d like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Perl Medic: Maintaining Inherited Code [Paperback]

Peter Scott
4.5 out of 5 stars  See all reviews (2 customer reviews)

Available from these sellers.


Formats

Amazon Price New from Used from
Paperback --  
Amazon.co.uk Trade-In Store
Did you know you can trade in your old books for an Amazon.co.uk Gift Card to spend on the things you want? Visit the Books Trade-In Store for more details. Learn more.

Book Description

5 Mar 2004 0201795264 978-0201795264 1

This book is about taking over Perl code, whether written by someone else or by yourself at an earlier time. Developers regularly estimate that they spend 60 to 80 percent of their time working with existing code. Many problems of code inheritance are common to all languages, but the nature of the language makes Perl especially tricky. The reason why is that Perl is similar to English - bursting with irregular verbs, consistent only when it's convenient, borrowing terms from other languages, and providing many ways to say the same thing. In fact, Perl developers have a motto with the abbreviation TMTOWTDI: There's More Than One Way To Do It. While this flexibility is one of the language's strengths, it also makes it extremely difficult when you are faced with an existing piece of code. There are millions of lines of Perl code being used all over the Web; much of it was built on an ad hoc basis, the creators never imagining that the code would still be in use months or years later. This book will be the resource all Perl programmers need to understand someone else's code, even when it's bad; repair it; convert it to a better style; upgrade it to the latest version of Perl; maintain it; and find and fix its bugs.



Product details

  • Paperback: 336 pages
  • Publisher: Addison Wesley; 1 edition (5 Mar 2004)
  • Language: English
  • ISBN-10: 0201795264
  • ISBN-13: 978-0201795264
  • Product Dimensions: 17.7 x 2 x 23.4 cm
  • Average Customer Review: 4.5 out of 5 stars  See all reviews (2 customer reviews)
  • Amazon Bestsellers Rank: 1,218,832 in Books (See Top 100 in Books)
  • See Complete Table of Contents

More About the Author

Discover books, learn about writers, and more.

Product Description

From the Back Cover

  • Cure whatever ails your Perl code!
  • Maintain, optimize, and scale any Perl software... whether you wrote it or not
  • Perl software engineering best practices for enterprise environments
  • Includes case studies and code in a fun-to-read format

If you code in Perl, you need to read this book.—Adam Turoff, Technical Editor, The Perl Review.

Perl Medic is more than a book. It is a well-crafted strategy for approaching, updating, and furthering the cause of inherited Perl programs.—Allen Wyke, co-author of several computer books including JavaScript Unleashed and Pure JavaScript.

Scott's explanations of complex material are smooth and deceptively simple. He knows his subject matter and his craft-he makes it look easy. Scott remains relentless practical-even the 'Analysis' chapter is filled with code and tests to run.—Dan Livingston, author of several computer books including Advanced Flash 5: Actionscript in Action

Bring new power, performance, and scalability to your existing Perl code!

Today's Perl developers spend 60-80% of their time working with existing Perl code. Now, there's a start-to-finish guide to understanding that code, maintaining it, updating it, and refactoring it for maximum performance and reliability. Peter J. Scott, lead author of Perl Debugged, has written the first systematic guide to Perl software engineering. Through extensive examples, he shows how to bring powerful discipline, consistency, and structure to any Perl program-new or old. You'll discover how to:

  • Scale existing Perl code to serve larger network, Web, enterprise, or e-commerce applications
  • Rewrite, restructure, and upgrade any Perl program for improved performance
  • Bring standards and best practices to your entire library of Perl software
  • Organize Perl code into modules and components that are easier to reuse
  • Upgrade code written for earlier versions of Perl
  • Write and execute better tests for your software...or anyone else's
  • Use Perl in team-based, methodology-driven environments
  • Document your Perl code more effectively and efficiently

If you've ever inherited Perl code that's hard to maintain, if you write Perl code others will read, if you want to write code that'll be easier for you to maintain, the book that comes to your rescue is Perl Medic.

On the Web Site

Download all of the book's sample code from .

About the Author

PETER J. SCOTT runs Pacific Systems Design Technologies, providing Perl training, application development, and enterprise systems analysis. He was a speaker on the 2002 Perl Whirl cruise and at YAPC::Canada, and he founded his local Perl Monger group. A software developer since 1981 and a Perl developer since 1992, he has also created programs for NASA's Jet Propulsion Laboratory. Scott graduated from Cambridge University, England, with a Master's of Arts Degree in Computer Science and now lives in the Pacific Northwest with his wife Grace, a cat, and a parrot, at least one of which also uses Perl. He is the lead author of Perl Debugged.


Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Reviews

3 star
0
2 star
0
1 star
0
4.5 out of 5 stars
4.5 out of 5 stars
Most Helpful Customer Reviews
4 of 4 people found the following review helpful
5.0 out of 5 stars One of the best Perl books out there 24 April 2004
Format:Paperback
A quote on the front cover of this book says "if you code in Perl then youneed to read this book". That's a pretty bold claim to make. It made methink of the hyperbole on covers of books that claim to teach you toprogram in Perl in just a few days. But this book is published by AddisonWesley, who are a well respected technical publisher of technical booksand the quote is from Adam Turoff who certainly knows what he's talkingabout when it comes to Perl programming. So in this case the claim isn'thyperbole. The book really is one that I want every Perl programmer toread.
Perl gets a lot of bad press from people who claim that it encouragespeople to write unreadable code. Whilst there's certainly a lot of verybad Perl code out there I think that's more a sign that it's used by a lotof people who don't know how to program than a reflection on the languageitself. And that's where this book comes in. It assumes that you arefamiliar with the syntax of Perl but that you've never really been shownhow to use it effectively. Which is a situation that many Perl programmersfind themselves in.
Perl Medic is actually targetted at people who have to maintain older Perlcode written by someone else, but I think that the information it containsis just as useful to anyone coding in Perl. Peter Scott has a lot ofexperience in writing Perl and in training other people to write Perl andthe distillation of that experience and knowledge into these 300-odd pagesmean that there are few Perl programmers who won't pick up somethinguseful from this book.
The main emphasis in the book is on increasing the maintainability ofcode. The techniques are wide-ranging. I particularly enjoyed the examplesof refactoring programs and the coverage of using modules from CPAN. Twoother very good sections are the one on antipatterns in chapter 4 and theone on cargo cult programming in chapter 6. Together these sections give aprogrammer a number of easy to recognise quick wins when improvingexisting code and a checklist of things not to do when writing newcode.
There are a couple of niggles. I've already mentioned that I think thebook has been slightly mis-targetted and that it should have been aimed atanyone writing Perl code. The other problem that I had was that the medicanalogy that runs through the book gets a bit strained at times. But theseare only minor and they shouldn't prevent you from adding this book toyour library.
In fact, all in all, the quote on the front cover is pretty accurate.
Comment | 
Was this review helpful to you?
4.0 out of 5 stars Bad title, good contents 17 July 2007
Format:Paperback
Like author Peter Scott's previous book (co-written with Ed Wright), Perl Debugged, Perl Medic is rather inaccurately titled. Both books are collections of advice and tips on best practices and idioms in Perl, like Effective Perl Programming and Perl Best Practices. You can think of Perl Medic as a sequel to Perl Debugged. You definitely don't need to have read the former, but if you have, you should have a good idea about the format and contents you can expect here.

There is more advice on code style, low-level stuff like brace indentation and choosing decent variable names. Additionally, tracing, profiling, benchmarking and logging are again introduced. Some of this is admittedly rather reminiscent of what appeared in Perl Debugged. Happily, also present is the clear writing, which is informal without ever talking down to the reader.

Perl Medic, however, has a more agile flavour than Perl Debugged. Again, there is a chapter on unit testing, but it's much more fleshed out in this book, featuring far more modules, and providing an entire Test Driven Development example of a bounds-checked array.

Also, some refactorings are introduced, such as inlining temporary variables and extracting subroutines. The final chapter of the book is a refactoring example on some ancient Perl 4 cgi code, that pulls together most of the themes of the book.

There's also an in-depth discussion of what the strict and warnings pragmas entail, beyond that provided by most books. Also worthy of note is the chapter on 'cargo cult' Perl, where the author's pet peeves about non-idiomatic Perl code are explored, from practices which are merely pointless to the downright wrong.

Much of this material is general good practice. However, there are some chapters that help to justify the 'legacy code' approach. Chapter 7 provides a potted history of the different versions of Perl from Perl 4 onwards, and how to spot which version a program was targetted at. There is some mention of legacy code in the unit testing chapter, but not much.

In general, I think a lot of the suggestions will be obvious to anyone with experience with Perl, or experience with another modern programming language: use new modules from CPAN where you can, use lexically scoped (my) variables and localise global access and, of course, turn on strict and warnings. Overall, I wasn't much convinced with the 'legacy code' aspect of the book and the strained medical metaphor renders many of the chapter names nonsensical.

Another slight problem I had is that, like Perl Debugged, there can be a lack of flow between (and sometimes within) chapters. Chapter 10, nominally about maintainability, starts with assertions and Eiffel-style contract programming, and then goes onto logging, tieing, overloading, POD and version control integration. It's hard to see this as a cohesive whole.

If you're looking for a book on dealing with legacy code, Michael Feathers' Working Effectively with Legacy Code provides more bang for your buck -- although it's not Perl-specific (in fact, I'm pretty sure there's no Perl code in it at all). However, if you're a budding agilist looking for Perl-based examples of refactoring and TDD, then this is a good choice. Less experienced Perl programmers should definitely consider this, especially alongside Perl Debugged, as it provides both a good grounding in best practices, and more advanced development skills such as profiling and code coverage.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.4 out of 5 stars  7 reviews
16 of 17 people found the following review helpful
5.0 out of 5 stars Novel and effective tutorial in solid Perl Programming 18 Mar 2004
By Jack D. Herrington - Published on Amazon.com
Format:Paperback
You can learn a lot from books (or so it seems), but you can't learn a feel for the language. I had read all of the O'Reily Perl books and found myself in charge of a large Perl project writing new code. I hired on a real Perl guru and he taught me a ton, in person, about how to write Perl as Perl and do it well. What amazes me about Perl Medic is how much of what the Perl guru taught me is in this book. It's as if I had the man by my side again.

On it's face that makes it sound like you should pick up the book immediately. And for someone who is serious about Perl I think you should get this book. But there are still some faults. It could be a little better organized. And some of the common problems, like CGI scripts having embedded HTML, could be given more prominence and the text templating alternative given some more space. I looked in the tiny index for HTML::Template and found only two references, both of which were pretty short.

In what is probably both a curse and a blessing the book is not only about fixing legacy code. The majority of the book is about becoming a better Perl programmer and writing Perl as Perl. There are a few chapters and the beginning and end that are specifically about working with legacy code, but the majority of the book is practical insights into Perl coding styles using code fragments with effective exposition.

Small problems aside. This unique book is fun to read and is packed with valuable insights if you spend the time to look. The author obviously knows a lot about Perl and understands how to convey that knowledge to the reader effectively. If you are looking to maintain some Perl, or if you have hit a plateau in your understanding of Perl and you need a push to get to a higher level this book is for you.

11 of 11 people found the following review helpful
5.0 out of 5 stars One of the best Perl books out there 24 Jun 2004
By David Cross - Published on Amazon.com
Format:Paperback
A quote on the front cover of this book says "if you code in Perl then you need to read this book". That's a pretty bold claim to make. It made me think of the hyperbole on covers of books that claim to teach you to program in Perl in just a few days. But this book is published by Addison Wesley, who are a well respected technical publisher of technical books and the quote is from Adam Turoff who certainly knows what he's talking about when it comes to Perl programming. So in this case the claim isn't hyperbole. The book really is one that I want every Perl programmer to read.

Perl gets a lot of bad press from people who claim that it encourages people to write unreadable code. Whilst there's certainly a lot of very bad Perl code out there I think that's more a sign that it's used by a lot of people who don't know how to program than a reflection on the language itself. And that's where this book comes in. It assumes that you are familiar with the syntax of Perl but that you've never really been shown how to use it effectively. Which is a situation that many Perl programmers find themselves in.

Perl Medic is actually targetted at people who have to maintain older Perl code written by someone else, but I think that the information it contains is just as useful to anyone coding in Perl. Peter Scott has a lot of experience in writing Perl and in training other people to write Perl and the distillation of that experience and knowledge into these 300-odd pages mean that there are few Perl programmers who won't pick up something useful from this book.

The main emphasis in the book is on increasing the maintainability of code. The techniques are wide-ranging. I particularly enjoyed the examples of refactoring programs and the coverage of using modules from CPAN. Two other very good sections are the one on antipatterns in chapter 4 and the one on cargo cult programming in chapter 6. Together these sections give a programmer a number of easy to recognise quick wins when improving existing code and a checklist of things not to do when writing new code.

There are a couple of niggles. I've already mentioned that I think the book has been slightly mis-targetted and that it should have been aimed at anyone writing Perl code. The other problem that I had was that the medic analogy that runs through the book gets a bit strained at times. But these are only minor and they shouldn't prevent you from adding this book to your library.

In fact, all in all, the quote on the front cover is pretty accurate.

8 of 8 people found the following review helpful
5.0 out of 5 stars A good book with a misleading title 18 May 2004
By Kenneth Graves - Published on Amazon.com
Format:Paperback
While the "medic" metaphor recurs throughout the book, most of the material isn't directly related to repairing old code. Instead, this is a collection of best practices for new code. (The author recommends rewriting existing code if at all possible.) It ends up resembling another excellent Perl title, Joseph Hall's Effective Perl Programming. Good company to keep. Perl Medic has the advantage of being newer, and of covering a bit more material. The writing style is very easy to read, and the order of presentation works well. An excellent title for any intermediate-level Perl programmer.
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Listmania!

Create a Listmania! list

Look for similar items by category


Feedback