in reply to Opinions on migrating Perl scripts from 5.005 to 5.8.1?

P.S. I don't want to sound resistant to the idea of re-writing everything from scratch (but, really, I am a little resistant because of my deadlines). A couple of other facts I forgot to put in:

I need to create a handful of other new reports (with all the variations/flavors/details they might need) in our current database. Then, I'll need to upgrade that script to run against our new database once it's migrated from Sybase to Oracle, and from an old version of PeopleSoft to a new version of PeopleSoft.

  • Comment on Re: Opinions on migrating Perl scripts from 5.005 to 5.8.1?

Replies are listed 'Best First'.
Re: Re: Opinions on migrating Perl scripts from 5.005 to 5.8.1?
by chromatic (Archbishop) on Sep 22, 2003 at 16:49 UTC

    I think your fear of rewriting from scratch is quite good. Since you have new development work to do, now is a great time to start writing tests. I wouldn't write tests for the whole system, just the parts you touch. When you've tested an individual piece sufficiently, take a few minutes to clean it up.

    If the important parts of the program are in the bit that creates reports, you'll have tested and cleaned the most important parts of the program once you're done. With those tests in place, it'll be much easier to port the program to Perl 5.8.

    You can find more information in Five Lessons You Should Learn From Extreme Programming and Five Lessons Open Source Developers Should Learn From Extreme Programming.

Re: Re: Opinions on migrating Perl scripts from 5.005 to 5.8.1?
by dragonchild (Archbishop) on Sep 22, 2003 at 15:39 UTC
    Lori713 - You need to rewrite the system. You could shoehorn the old system in with the new back-ends, but it would be very risky. This is compounded by the fact that you have no test-suite.

    I'd rewrite it using Test-Driven Development methods. Write the test, have it fail, then write the code that makes that test pass. Lather, rinse, repeat. There are a number of nodes regarding TDD on Perlmonks and other venues. It makes things very simple for a newer developer because you're focusing on results, not methods. Also, if you ever want to change something, you have a test-suite that describes what this thing is supposed to do. :-)

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.