Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Reactionary Coding—One-Shot Programs

by dragonchild (Archbishop)
on Jun 13, 2001 at 23:06 UTC ( [id://88164]=note: print w/replies, xml ) Need Help??


in reply to Reactionary Coding—One-Shot Programs

I would say that if you have a problem that comes up as a one-off-type problem, code a one-off-type solution. But, save that solution somewhere. Maybe, you play with it and hack it into a more general solution. Maybe not. But, you save it in your personal scripts directory with some notes as to what it was used for.

Six months later, someone will come up and ask for a slight modification. Then, when there's two times you want to run it, make it a generic mini-application.

Once is a one-off ... twice is a mini-app ... three times is a solution. :-)

Replies are listed 'Best First'.
Re2: Reactionary Coding—One-Shot Programs
by John M. Dlugosz (Monsignor) on Jun 13, 2001 at 23:21 UTC
    I agree. It might get "reused" in that having done that before I can write another similar one real quick. Or, if it's very similar, I can dig up the script and edit it, changing the names and such. Just because it's specialized doesn't mean it has to be bad code. So source and dest names, etc. can be noted as constants at the top of the script, and assumptions can be documented as comments.

    —John

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found