[mdlug] I need a script Hero

David Favro mdlug at meta-dynamic.com
Fri Feb 2 09:18:40 EST 2007


Raymond McLaughlin wrote:
> Can you name an instance where the presence of an extension caused a
> problem? Particularly a problem that wasn't really a problem of poor
> documentation?
>   

Sure.  I create script, e.g. find-all-junk-files.bash and another script
that uses it, e.g. delete-all-junk-files.bash.  Now let's say that I use
the first script (find-all-junk-files.bash) in many places in many other
scripts.  Next, I decide that the first script needs better performance,
so I recode it in C++.  The resulting executable, since it is not a
script, presumably must now be named just plain "find-all-junk-files". 
Now, must I find *all* of the references to it in other scripts?  If my
script/program is part of a publicly distributed system, what about all
the other people who wrote scripts that use it?  Later, I recode it in
Perl, and every reference must be changed to '.pl', and on a whim, I do
it again in Python -- now I must try to find every reference and change
to '.py', right?

That said, bad habits are hard to kick, and I still name all of my shell
scripts foo.bash.  I think it's dishonest (and causes problems like the
one that started this thread) to call a script '.sh' if it uses any bash
extensions to the Bourne shell, which I almost always do.

IMO, all of this is caused by the fact that most popular filesystems
don't include a file-type field in the meta-data, which I have
considered a great idea for a very long time, but it just hasn't caught
on.  Mixing two different pieces of data (name and type) in the same
field is generally very bad database design, and after all, that's
effectively a big part of what filesystems are.




More information about the mdlug mailing list