[Pdx-pm] Fwd: Genomics at OHSU

Ovid publiustemp-pdxpm at yahoo.com
Mon Nov 28 12:59:52 PST 2005

Almost invariably the serious gripes I hear about Perl come from those
who know the language well.  Perl has some real problems but those who
are less familiar with the language have probably heard the "meme"
gripes and they're happy to parrot them.  The "illegible" gripe really
annoys me as we don't hear that leveled much against PHP even though
programmers unfamiliar with either language would be hard-pressed to
tell them apart.

> > My gripe against Perl is that I can't make heads or tails out of  
> > someone else's code without a language manual by my side. Do you  
> > have any experience in taking and adapting someone else's largish  
> > Perl code? Perhaps your experience is different.

I find I have problems making heads or tails out of any programming
language I'm unfamiliar with but since it's popular to bash Perl,
people feel OK to say "I don't get it" and somehow claim this is Perl's
fault rather than their own.  There are many programmers who have
plenty of experience with other languages and yet don't have any
problems understanding Perl.  That a handful of people who don't know
the language well seem to dominate the opinions really says a lot about
the power of "truth by repetition".

Consider the Chinese language.  If you're learning the language and
your instructor forgets to tell you about its tonal nature (or you
never learned), then you will have a much harder time learning the
language.  Two words which sound identical to you can have vastly
different meanings if the pitch is off.  The same goes for Perl (in a
manner of speaking):

  my $data   = $line =~ /($some_regex)/;
  my ($data) = $line =~ /($some_regex)/;

It's almost guaranteed you want the second line and for a "native" Perl
speaker who's familiar with the notion of "context", it's quite
understandable why.  To someone who never learned about context in
Perl, they may not even see the difference between those two lines.  If
they don't see it, they'll break it.

Of course, we can extend this further by discussing the notion of

  print foreach @item;

You see, Perl's really a big language and it's not a toy. 
Unfortunately many people who don't know Perl assume it's just like the
languages they're familiar with and in many respects this simply isn't
true.  However, just as a native Mandarin speaker has no problem with
the tonal nature of Chinese, someone who knows Perl has no problems
with how context and topics work even though they might not even know
those two words.

Unfortunately, those are two core concepts which are not taught or
explained well to many new programmers.  People come to Perl thinking
that because they know C or Java that Perl will be a snap and they run
away screaming "Perl's not C or Java!"  Which, of course, it doesn't
pretend to be.

So to a certain extent I would claim your friend is right.  Perl, like
Mandarin, *is* incomprehensible if you only learn a little bit and have
missed some of the basics.  I'm willing to bet that he doesn't know
Perl well.  Frankly, while I know a little Scheme, I don't know it well
and I find the language unreadable despite its lack of syntax.  I
suspect Schemers would my criticizing Scheme as being unreadable would
my find my assertion just as laughable.  Further, were I to confuse my
inability to understand Scheme with silly assertions about its utility,
I would look sillier still.

Mind you, there are some issues which can make Perl illegible but the
biggest is probably how easy it is to work with the basics.  This has
attracted a lot of sysadmins, Web developers and others who may have
little programming experience.  Because Perl's so easy to start with,
I've seen more bad beginner code in Perl than I have in most other
languages.  This, unfortunately, is probably an unsurmountable problem.


If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

More information about the Pdx-pm-list mailing list