perl [was: in defense of Java, again]
bryan.sant at gmail.com
Fri Jan 27 11:25:10 MST 2006
On 1/27/06, Ross Werner <ross at agilestudios.com> wrote:
> On Fri, 27 Jan 2006, Jonathan Ellis wrote:
> ("obfuscated Perl contest? Isn't that redundant?")
Ha! That's awesome. I'm going to use that line in the future :-).
> *What*, exactly, about the language causes this? And can you find any
> examples of how it's true in projects out there? Surely your opinions must
> be based on some feature in the language that you see time and time again
> being abused and turning otherwise decent code into an unreadable mess?
I can't speak for Jonathan, and I'm not a perl hater, but I would say
that perl is (or at least can be) messy because the syntax is too
rich. There are too many ways to express the same thing. To be fair,
a developer's personality will shine through in the way they write
code with any language. But perl allows a *way* bigger spectrum of
coding style. I'm far more likely to run into perl code that was
written in a totally bazaar fashion compared to *my* perl coding
style. This makes life harder for me more often. Though perl's
liberal syntax was working *with* the original author's way of
thinking, it is now working *against* me and the way I think now that
I have to maintain the prior guys "crap" (crap from my perspective not
the original author or even another developer).
In a more structured language like Python or Java, I am less likely to
run into someone else's code that looks so different from how I would
have written it myself (syntax-wise) because the language syntax is
comparatively restricted. I view this as "a good thing" (tm). I like
consistency and predictability. But you may not like those
trade-offs. That's cool. But it's fair to say that more people
consider the majority of perl code they come across as "messy" because
"no two people write perl the same" (I know this is an exaggeration).
More information about the PLUG