perl [was: in defense of Java, again]
shane at hathawaymix.org
Fri Jan 27 01:40:51 MST 2006
Jonathan Ellis wrote:
> On Wed, 25 Jan 2006 21:08:44 -0700, "Michael Torrie"
> <torriem at chem.byu.edu> said:
>>Other that code written very clearly, perl is one of the easiest
>>languages to write unreadable code in that a future maintainer will have
>>no hope of understanding. It's not the one always implies the other;
>>just that it's more probable. One of my CS professors said it best.
>>Perl is a great language for doing lots of things quickly, and it's very
>>powerful. However in the hands of most people perl is a "write-only"
> Often, perl fanboys will respond to this with something like, "but you
> can write unmaintainable code in any language!" That's true. However,
> as Erik Naggum said, "It's not that perl programmers are idiots, it's
> the language rewards idiotic behavior in a way that no other language or
> tool has ever done." (From a semi-famous post on perl:
> http://www.underlevel.net/jordan/erik-perl.txt. Warning: bring a thick
> skin if hearing "perl is broken" brings emotions similar to "your
> daughter is ugly.")
> That's why these days you mostly see sysadmins and other not-really-
> experienced developers using Perl. Or, professionals using it as an
> awk/sed replacement, which is what it was designed for and which it's
> quite good at.
While I also prefer Python, putting down Perl programmers is
I actually think Perl has a really provocative philosophy. As I
understand it, Larry Wall is a linguist, and he has observed that spoken
languages evolve in strange ways, so why shouldn't programming languages
do the same? The result might be a programming language that
assimilates new concepts with ease, enabling it to progress faster than
other languages, at the cost of having no absolute rules. Combine that
with the open source philosophy and you have an exciting language.
Java is admirable because it knows its target audience. Programmers
want an assurance that their software will be fast, they don't want to
manage memory at a low level, they don't want to care about different
operating systems, and they want to assemble software like a puzzle.
Java makes those ideals a top priority and fulfills them pretty well.
Python has similar ideals, but it puts places readability as a higher
priority than all others. After all, good code will be read a lot more
times than it's written, so optimizing for the common case means
everything should be expressed as clearly as possible. Python can be
abused like any other language, of course; I've written a few unreadable
hacks myself. But for the most part, Python code is readable. It's
also easy to write, fast, cross-platform, and very modular.
I haven't studied Ruby in the same depth, but Ruby seems to be the
language that says "Perl's philosophy is good, but let's guide the
evolution a little more." That's a mature attitude, so I suspect Ruby
is going to continue gathering well-deserved popularity.
More information about the PLUG