[TriLUG] perl question
Michael Peters
mpeters at plusthree.com
Sun Mar 15 09:54:01 EDT 2009
Steve Litt wrote:
> Hey, I see the value in Perl -- its regular expressions are better than the
> rest. I just got done just now making a mailing label program in Perl (and
> awk). But elegant Perl? There's only so elegant anyone gets in Perl. After
> all, there are many ways to do it (Larry's words, not mine), and each is
> wierder than the last (my words :-).
A little biased aren't we :) I've seen a lot of bad Perl, but I've seen just as
much bad PHP, C, Java and VB. And if I'd ever worked in the Python or Ruby
worlds I'm sure I would see just as much bad code written in those languages.
Bad code is mostly written by
a) novices
b) people who come into programming from other spaces but it's not their primary
role (designers, sys-admins, biologists)
c) people who are trying to write in one language while using another (writing
Perl in Bash style, writing Ruby in Perl style, writing Java in C style, etc)
Bad code is not specific to any language and solutions can be elegant in any
language.
> After
> all, there are many ways to do it (Larry's words, not mine), and each is
> wierder than the last (my words :-).
If anything, having multiple ways to do something increases the elegance of some
solutions because it doesn't force you into something that is less elegant
simply because you don't have a choice. This obviously means you can choose the
in-elegant solution too.
English has lots of ways to say the same thing, but that doesn't mean it can't
be elegant. Of all the languages I've programmed in, Perl fits my brain the best
and I've been on some good teams of good programmers who were using Perl and
I've seen some very elegant Perl code. Obviously your experience has been different.
--
Michael Peters
Plus Three, LP
More information about the TriLUG
mailing list