[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Using UNIX style filenames with MacPerl



At 11:46 -0700 98/05/17, Douglas P. McNutt wrote:
>
>Fixed file names are almost the equivalent of assuming a date is 19xx.

Doug's got a good point.

When writing "category 0 code" (used by yourself and no one else) embedded path
names are (if not the best coding practice) perhaps acceptable.  As the code
passes into category 1 ( aka "alpha" or used by friends) and category 2 (aka
"beta", friend of friends), hard-coded paths are less acceptable.  As are
hard-coded constants.

At category 3 ("released", used by people you may never meet), hard-coded stuff
should have been removed.  The modules submitted to the CPAN _should_ be
category 3 code.  Except for a few "file in the current directory" things
(maybe) these modules should look for what they need in "well-known" places:
along the path, in the Libraries paths, etc.

So (imo) much of the discussion we are having involves a desire to modify
MacPerl to deal with code that should have been written differently in the
first place.

That said, unfortunately, some of us still have hard-coded paths in our code;
at work we're gradually going through and removing the pathnames from the code.
When I work on a script, I may not always be in a position to remove those
hard-coded paths this time (sigh). When this code was written, only "we" used
it. Now (gleep!) we've making it available to customers and _they_ don't seem
to want to need /data/blastdb directories on their systems (fancy that :-).
It's a toss-up.  Our simple hard-coded Perl scripts now require more
file/directory name arguments. The burden shifts from the script to the user.

Vicki

(in case you're interested, category 4 is "you don't need to explain why you
use this program" and category 5 is "you may be called upon to explain why you
do not".  Perl is at about 4.5.  MacPerl is probably still at 3.5.  The
categories come from a Usenix talk by Stu Feldman some 8 years back.)
---
Vicki Brown, vlb@cfcl.com        |\      _,,,---,,_
Journeyman Sourceror      ZZZzz /,`.-'`'    -.  ;-;;,_
Scripts & Philtres             |,4-  ) )-,_. ,\ (  `'-'
http://www.cfcl.com/~vlb      '---''(_/--'  `-'\_)
P.O. Box 1269 San Bruno, CA  94066

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch