develooper Front page | perl.perl5.porters | Postings from May 2000

RE: Thoughts on maintaining perl

Thread Previous | Thread Next
From:
Chris Nandor
Date:
May 26, 2000 06:06
Subject:
RE: Thoughts on maintaining perl
Message ID:
p04310119b554155f582d@[192.168.0.77]
At 7.36 -0400 2000.05.26, Horsley Tom wrote:
>Finite? Yes. Small? I wouldn't call it that, not compared to
>other languages. There are bazillions of special cases
>in perl, and if you don't actually have them all
>memorized and cached for easy access, you can easily
>read a line of code and not even realize it is using
>one of the special cases.
>
>Things like implicit defined(), implicit $_ or @_
>or @ARGS, different meanings for random sets of
>functions in scalar context, for that matter, just
>recognizing if you are in "scalar context" or not.
>Compare this to C - it basically only has one weird
>special case with pointers and arrays sorta being
>the same sometimes except when they aren't.
>
>These are all things that usually make perl easier
>to write, but they definitely don't make it easier to
>read. The learning curve to get them all into your
>awareness so you can do effective maintenance on perl
>is steeper for perl than many other languages (PL/1
>is probably worse - you can't even do arithmetic
>in PL/1 without a degree in number theory :-).
>
>I hasten to add that I don't think any of this makes
>perl inappropriate for "production use". I think the
>huge advantages perl has for development more than
>offset the extra time it takes in maintenance, but
>I think it is harder to maintain.

The reigning evangelical theory (when I was in school) of the language of
the New Testament was that Koine Greek was used because it was so simple
and straightforward.  In some parts it was slightly more complex than the
average language (like in its concepts of love), but those apparent
complexities only made it less ambiguous.  It was easy to write things in,
though perhaps it took a little longer, and it was very easy to understand
by everyone.

However, most of the writing of the day was not done in Koine Greek, but
Classical Greek.  For awhile, people questioned if Koine Greek existed as
language of the day, since so few examples outside of the New Testament
were around.  So why was it used for the New Testament?  Because everyone
knew it.  There are only about 5600 different words used in the New
Testament.  People could follow it without much education.

If I am writing a small script for distribution to lots of people, I use a
smaller and more straightforward subset of Perl.  But in the general case,
when I am working on real code, I'll use the full power of the language.
And if someone can't read it, it is probably because they are not educated
enough, and they can pick up a manpage and start learning.

I hate to compare my Perl to the Iliad (much less to the New Testament),
and I think Programming as Literature has perhaps been done to death.  But
this point bears repeating: I write in Perl because I like it.  If I had to
get stuck with shell and awk, I would go to truck driving school.  If Homer
had to write in Koine Greek, there's no telling what he would have ended up
with.  Perhaps he could have pulled it off.  And perhaps I won't like truck
driving as much as I think I would.  But the point is that I won't be
giving up the language I love so that other people can understand it more
easily.

You don't hire a book editor who barely knows English to edit William F.
Buckley's latest tome.  Why should you hire a perl novice to come in and
maintain my code?  Again, I am not trying to elevate myself to the level of
Buckley, but just using him to make a point.  You might say that
programming is different than prose, that you can't compare the two, that
programming is almost purely functional and the stylistic demands on it are
far different and far more strict.  And perhaps it is.  But if so, then
find me that toll free number for TruckMaster, 'coz I think I'm gonna need
it.

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About