Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: How to modify existing code

by jreades (Friar)
on Jun 20, 2001 at 21:11 UTC ( [id://90084]=note: print w/replies, xml ) Need Help??


in reply to Re: How to modify existing code
in thread How to modify existing code

rewriting++

100 different scripts sounds like a nightmare (especially if you didn't write them), but I suspect that you're likely to find a lot of overlap between various scripts.

Here's a possible sequence of events for the least painless port:

  1. As Beatnik suggests, you want to try to understand what the scripts are doing first
  2. Now try to understand what the tools the scripts need to accomplish their respective tasks are
  3. Now try to highlight areas for re-use -- e.g. database access wrappers for DBI, printing feedback to the user (either HTML, text, or graphical)
  4. These reusable elements are likely to be good candidates for either modules or objects, depending on what they do
    • Remember that objects are normally wrappers to data,
    • while modules are ways of reusing useful functions
    • This is very loose, but what I'm getting at is that in a scripting-oriented language, not everything has to be, nor should be, an object
  5. Comment, comment, comment -- how many times have you come back to your own code only to say: "What the hell was I trying to do here?"

HTH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://90084]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-24 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found