

Perl: Kicking your languages ass since 1988 - mmaunder
http://markmaunder.com/2010/perl-kicking-your-languages-ass-since-1988/

======
beej71
I didn't realize I had a "languages ass" on my person. But come to think of
it, I do believe I had it kicked when I had to refactor a giant Perl program
for HP many many years ago.

It definitely left me with a lasting impression.

~~~
pyre
Bad code and poor design can happen in any language. Basing an argument on how
'good' or 'bad' a language is around anecdotes that contain either of those is
the equivalent of setting up a strawman.

[ Note: I'm not talking about bad code in the languages core
interpreter/compiler/vm nor am I talking about poor design decisions in the
languages themselves. ]

~~~
mkramlich
I think the valid criticism of Perl is not to say it's bad but to say that
compared to the alternatives, it's farther from ideal, in certain important
dimensions. Perl lives in the same world with Python, Ruby, Java, Clojure,
etc. so whenever one can reach for Perl one can also reach for any of those
other languages.

It's not that bad language yields bad code, it's that people who are picky
want good code AND the best language to express it in. In some folk's minds,
there are languages available to them that have the same strengths as Perl,
can be used in the same role as Perl, and yet have less of it's imperfections.
I think that's the strongest case against it. Not that it is a "bad" language,
necessarily.

~~~
jrockway
I have a hard time using those other languages, because they just aren't as
mature and featureful as Perl 5/CPAN. I like to organize my applications as
composable parts ("roles"), and the only other language that has a sane role
implementation is Scala. And sadly, Scala had a little too much Java for
breakfast and got them mostly wrong.

I remember a few years ago when I wrote Perl OO and said, "I wish this was
more like Common Lisp". Now I can barely get past "(defclass" without wishing
I was using Perl instead. (And then I usually switch the project to Perl; the
8-billion-x or whatever speed hit is well worth Moose's design sugar.)

Anyway, I spend a lot of time thinking about programming and application
design, and I just can't get Clojure or Ruby or Python or Java to a point
where they could be usable for the kinds of things I do. And Perl already has
everything I would need to add to those languages.

The only other language I really like is Haskell. It is much better than Perl.
But Perl has so many good libraries (and great library authors), that I don't
see myself switching completely to Haskell for a long time. I can stand a
little bit of computer science imperfection if it means I have an application
that works. With Perl, I always end up with an application that works.

Honestly, hating Perl and then saying to use Ruby or Python or Clojure instead
is kind of silly. All languages in this category have the same fundamental
weaknesses... they just all spell the weaknesses differently.

------
teilo
In the spirit of answering the ridiculous with the equally ridiculous, I offer
the following response:

Mark: "Perl is a powerful language. It’s also fast and everything you need has
already been implemented, debugged, refactored, reimplemented and made rock
solid. If you ever have a problem, it’s already been solved by someone else."

Me: "That's just what I've been saying all this time! Everything that can be
invented has already been invented. Don't waste your time trying to do it
better, you silly young bucks.

Now get off my damn lawn!"

~~~
pyre
I think the problems lie in reimplementing something with disregard for the
experiences gathered when it was implemented the first time. There are plenty
of times where solutions a wiped up to age-old problems that only work in the
most common of cases, and cause huge headaches when the edge cases are hit. On
the other hand, mature solutions with wide user-bases have already run into
and solved these problems.

Basically, there's no point in re-inventing the wheel unless you're meaning to
improve the existing implementation or at least bring something new to the
table. Too many times things are re-implemented and labelled as 'new and
improved' even though they are a decided step backwards.

All of that said, I think that original statement was meant to be a push-back
against the prevailing 'wisdom' that Perl is dead and that you should really
be onto something like Python or Ruby like all of the 'cool kids' are doing.
(i.e. "Don't discount Perl, it has many solutions to offer you.")

------
viraptor
Someone drank the Kool-aid. "everything you need has already been implemented,
debugged, refactored, reimplemented and made rock solid." -- right... I have
enough of "broken-module forcing a manual rebuild of half of existing modules"
stories to fuel my nightmares for life. There are broken modules, there are
specific-distro-and-version-only modules, there are undocumented modules, etc.

I'm not sure I believe any serious Perl programmer never run into those
problems.

~~~
jrockway
_broken-module forcing a manual rebuild of half of existing modules_

Very few modules are actually "built". Most building is just "cp lib/*
$PERL5LIB". If you mean some module required a newer version of another
module, and that new module was installed... yeah, that happens. That's why
there's a dependency management system.

 _There are broken modules, there are specific-distro-and-version-only
modules, there are undocumented modules, etc._

Some people think one bad apple spoils the whole bunch. Others think a rotten
apple is better than no apple at all. It's usually the second group that has
working applications, and the first group that whines on social news sites
about how bad everything is. Just sayin'.

~~~
viraptor
To be honest, I've got had more problems updating from CPAN in general than
any other package systems -- but that's just a data point. What I meant is
that when anyone writes any claims about "everything you need", my fanboy
detector starts beeping. No - it does not have everything I need - and that
applies to almost anything...

I'm not even saying that CPAN is bad in any specific way. But it's by no means
perfect, or close to the description he gave. Neither is any other language /
package system. It's just annoying when someone claims something like that.

~~~
jrockway
Most of the problems people have installing software from CPAN are related to
the fact that the module's entire test suite is run on your machine before it
is installed. If a test fails, it means the module doesn't work on your
machine, and it _shouldn't_ be installed until it's fixed. If you just install
the Debian package or whatever, then you are simply installing software that
doesn't work on your machine.

If you just want to copy files from lib/ to your system @INC, then sure, go
ahead. But then you are throwing away any stability guarantees in favor of
"BUT I WANT IT NOW!!!"

~~~
chromatic
_If a test fails, it means the module doesn't work on your machine...._

... or, in many cases, the test is wrong in some fashion. This pushes the
responsibility to the person running the test to report the failure and the
distribution maintainer to fix the problem.

------
swolchok
language's (or languages')

~~~
mmaunder
Perl developers can't spel either. [Thanks, I fixed it]

BTW, I'm a huge fan of Ruby. I sincerely hope it has the legs Perl has and one
day is it's equal or better. Perl's invent-your-own-OO-syntax is it's worst
weakness - and that's what Ruby brings IMHO. So I'm very grateful to all the
early adopters who are so passionate about Ruby.

Having said all that, keep a close eye on Perl 6. There will be some big
developments/announcements this year.

~~~
pyre
> _Perl's invent-your-own-OO-syntax is it's worst weakness - and that's what
> Ruby brings IMHO._

That being said, there are a number of languages that have things in them that
feel like dirty, dirty hacks. There are few languages that are fee from these
sorts of things.

~~~
stcredzero
"There are _quite a_ few languages that _let you earn a_ fee from these sorts
of things."

Fixed that for you! </humor>

------
BudVVeezer
Perl -- the world's premier write-only language.

~~~
melling
A bit of a cliche response. The fact is one can write maintainable code if
they so choose and 20+ years later people are still solving real problems with
it. It would be great if they cleaned up the language a little and finish
Perl6, but in the meantime, Perl 5.x and CPAN (<http://www.cpan.org/>) are
still quite relevant.

~~~
njl
I've been under the impression (tongue firmly in cheek) that Perl 6 is called
"Ruby".

~~~
mmaunder
No, it's called Rakudo. <http://dev.perl.org/perl6/>

~~~
njl
Mind, I'm not deeply involved in either the Perl or Ruby communities, but...

The de jure successor of Perl 5 might be Perl 6, but the de facto successor is
Ruby. That is where the momentum and mindshare has gone; my impression is that
Perl is easing back into it's old home as AWK's big brother. In all honesty,
how often do you hear about somebody writing a web application in Perl these
days? While my personal experience isn't really admissible as evidence, all
the people I know who used to write web apps in Perl are now writing web apps
in Ruby. A bunch of the ones who used to do system administration with Perl
are now working at Opscode doing systems administration in Ruby.

~~~
peterwwillis
this is, to me, evidence of why Perl is a great language. it's not something
people pick up to write web apps. you can write very good web apps with it,
but there are better options. but you can also use it to write virtually any
kind of application - and the libraries and supporting modules already exist
to allow you to complete it, quickly and well. you can probably use Perl for a
wider array of apps than any other language (largely due to CPAN). i just wish
people who don't know how to program with it would stop picking it up and
getting things done.

my company's 10-year old Perl webapps are still chugging along just fine, btw.

