OK... Here I am, sharing my not-always-popular opinions.
First of all, I would like to point out that I HATE using
the term script
when referring to any programming I write.
I will try to always use the term program
no matter what the intent or the size of the project we have,
it still involves programming. It also helps to legitimize the
use of Perl and other 'scripting' languages to others.
When I first started writing perl programs, I would write a small
program to perform a specific task or set of tasks and then forget about it.
I guess this is fine if we were only to use it once but this never seems to be the case.
I would often find myself, about two or three months later, looking for this now
obcure little program that I wrote and hoping that I didn't throw it out because
I need it again to perform a similar task.
After about a year or so of programming in this way (yes, I'm a slow learner) I decided that
I should build a library of these utilities that I can use them whenever I needed to. This made
it much easier for me to find them and I also found that I was using them more often because I
was able to find them so easily. Every time I would write something new, I would place it in
my library and have it ready for the next time I wanted to use it.
This led me to the next step:
I took about two weeks and converted my little utilities into modules, sometime combining several that
were related into one package. This was the point where I took a giant leap in my knowledge of
Perl and my appreciation for the efforts that others had put into their modules.
I guess the moral of the story here is that there is no such thing as a one-off. You will never write a program that will be used
only once. Always write it as though you were going to use it many times and keep it handy
so that you can find it and use it.
Does everyone here do this? Did it take me longer than most to realize what was definitely a timesaver?