The *ART* of Computer Programming

Brandon S. Allbery allbery at NCoast.ORG
Sat Mar 10 15:16:37 AEST 1990


As quoted from <655 at sagpd1.UUCP> by jharkins at sagpd1.UUCP (Jim Harkins):
+---------------
| In article <EMV.90Mar2161110 at duby.math.lsa.umich.edu> emv at math.lsa.umich.edu (Edward Vielmetti) writes:
| >My "one time" programs tend to be 80 characters or less and are
| >generally written as shell pipelines or perl one-liners.  
| 
| These are the worst, I find that 6 months later I spend more time trying to
| figure out how to use that 1-liner I left laying around than it would take
| me to write another to do the same thing.  The original assertion stands.
+---------------

Not necessarily.  My one-liners---with one exception case---are like Ed's; but
they're *literally* one-shot.  I type them in at the shell prompt, they run,
that's it (unless I use "fc -e"; rare).

The one exception case?  The equivalent of aliases, for use within programs
which don't run csh or ksh or to allow quick modification to e.g. menus.  For
example, I have a large number of entries on my MultiView menu which point to
scripts in $HOME/bin; those scripts are one-liners.  So my MultiView menu runs
a program called "netnews", which runs either "emacs -f gnus" or "rn" or "tn".
The other case is used in program development at telotech: a command called
(for example) "acpl" which does ". asqlinit; exec ACPL ${1+"$@"}"---"asqlinit"
is a script which sets up the Accell (tm Unify Corp.) environment, and is
sourced by any command or script which wants to use Accell on telotech.
Both of these sub-cases are always very simple.

And yes, this applies with Perl as well.  Not as often, since I'm not as "up"
on Perl as, say, Randal (or Larry), but I do use it with such interactive
one-liners.

And if I *do* write something complex, it gets commented.  You see, I *have*
had the problem of going back and trying to figure out what I was smoking when
I wrote *that* bit of code.  [ ;-) ]

++Brandon
-- 
Brandon S. Allbery (human), allbery at NCoast.ORG (Inet), BALLBERY (MCI Mail)
ALLBERY (Delphi), uunet!cwjcc.cwru.edu!ncoast!allbery (UUCP), B.ALLBERY (GEnie)
BrandonA (A-Online) ("...and a partridge in a pear tree!" ;-)



More information about the Comp.unix.wizards mailing list