Monday, November 30, 2009

Why Perl Lost It

Over the last several years it has become fairly obvious that Perl has lost the prominence and popularity it enjoyed in the late 90s and early 2000s, which can be seen from many different angles:
  • Google Trends [1] and the TIOBE index [2] show a steady decline over time [1]
  • A wide reaching survey at Langpop places Perl near the bottom [3]
  • A lot of Perl talk centers around people vigorously stating that Perl is not dead [4] and other kinds of cries for attention [5]
There are many reasons behind this decline, but put quite simply, Perl was outclassed by the competition and lost mindshare amongst developers.

On the low end, PHP became the defacto web development language thanks to its ease of development and deployment. While many developers decry PHP's ugliness and its simplistic nature (no closures, no namespaces, 3000 functions), it nevertheless made web development far more accessible to everyone and thus allowed a huge number of people to make the products they wanted, and helped some notable companies (Flickr, Facebook etc).

On the other end, Python's steady improvement over the years (which made it both more powerful and easier than Perl) attracted a lot of companies and developers, while Ruby and Rails attracted developers who wanted more flexibility out of their language. While this was happening, there were no significant releases to Perl5 and Perl6 was nowhere in sight.


Another significant factor I believe was Perl's much beloved "There's More Than One Way To Do It" principle. While marketed to developers and giving them freedom and flexibility, it also hamper's Perls practicality.

First, it makes the language extraordinarily complicated. While most good designs struggle and strive for simplicity and coherence (the K.I.S.S. principle), Perl goes for the kitchen-sink mentality. Its table of operators can only be described by "gargantuan" and is only eclipsed by its grammar, which is at least 5 times larger than the grammars of languages like Python and Haskell. What this means is that Perl demands far more time out of a developer to become proficient at it, while offering no significant benefits for someone investing this extra time.

Second, it makes it hard for the community as a whole to progress. For example, while Python added new-style classes and pushed everyone into adopting them, there is no way for Moose to easily obtain the same ubiquity (as no one can push it and enforce it). In fact, it is rather telling that Perl's premiere web development framework, Catalyst, only acquired a decent object system in mid 2009.

Whether Perl will continue to decline or not is hard to say, though I highly doubt it'll ever return to its former glory - neither Perl5 nor Perl6 seem to offer much for developers who do not already love Perl.


[1] http://www.google.com/trends?q=perl%2C+python%2C+ruby&ctab=0&geo=all&date=all&sort=0
[2] http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
[3] http://langpop.com/
[4] http://www.slideshare.net/Tim.Bunce/perl-myths-200802?src=embed
[5] http://blog.newint.org/tech/2009/11/26/perl-dont-ingore-it/
Easter Egg: The Forex Chart Monkey gives advice on Picket Prevention and Forex Technical Analysis

17 comments:

Jeremiah said...

Logically there seems to be a contradiction or two in your post Mr. Drashkov. Firstly, if something provides "more freedom and flexibility", wouldn't that be a practical gain? Yes, perhaps there are more parts of the grammar to learn, but there are parts that suit your style so you learn them and you're done with it.

Unfortunately, I don't see a lot of perl knowledge in this post, so I am skeptical as to how well you can actually judge perl and if it has in fact lost 'mindshare'.

I will say however that perl is developing much faster than python; new tools, a meta object model, new CPAN modules, fixes to perl5's core are all now available, with lots more to come. Plus perl6 is moving rapidly and most likely going to be released in six months or so.

Of course, feel free to chose which ever programming language you like - but maybe dig a tiny bit deeper before firing off your opinion pistol.

zimpenfish said...

"Plus perl6 is moving rapidly and most likely going to be released in six months or so."

Someone archive this post for Claim Chowder in 6 months time!

Ovid said...

Ignoring the rather "me too" nature of your post (the blogosphere seems to be a great platform for meme spreading), I note you say that the http://langpop.com/ survey places Perl near the bottom, but looking at that site shows nothing of the sort. Tiobe (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html), meanwhile, shows that Perl is solidly in the top ten of programming languages and has been for many, many years.

Ruby shows up well on (some) of your data, but the resources you cite tend to measure "buzz" rather than reality. For example, on all of them, if you searched for COBOL, you might mistakenly conclude that it's dead, but the Gartner Group estimates that 3/4 of the world's business data passes through COBOL, a quarter of a trillion lines of COBOL code is still out there and it's still a force in the job market, but not in the "buzz" market (and yes, I realize this comparison is unfortunate in the eyes of some).

So paying attention to job stats instead of buzz, you can read through Tim Bunce's "Perl Myths" talk (http://blog.timbunce.org/2008/03/08/perl-myths/) and you see that Perl lags behind PHP, but still easily outclasses both Python and Ruby (by some metrics, it outclasses their combined stats).

Mark Beihoffer said...

Sure, Ruby & Python are great languages that are a little more modern in some ways than Perl.

And I like Lisp, Haskell, and Scheme for projects that require precision or subtlety in ways that most scripting languages can't provide.

But, really, Perl actually *won*. It's used in *sooooo* many industries, in so many capacities, and with such a great success rate that Perl will be around for the rest of our lives.

Sure, it might never again be the only Internet Tough Guy on the block, but speaking as a Perl programmer, I've learned a lot from some of the Ruby guys I hang out with, and I really like the Lisp community to.

We don't have to treat each other like competitors or play cut-throat anymore, dude. Drop the attitude. If you don't like Perl, don't use it.

Blog posts like this are just language-baiting wastes of time.

Aaron Trevena said...

so.. wrt langpop, if you remove deli.co.us, then Perl comes out ahead of python in the normalised graph - deli.co.us is probably reflecting the froth and hot air, same as reddit, etc.

when it comes to more objective measures, like jobs, salaries, Alexa 100 websites, counting user groups, conferences, etc then perl comes out ahead or level with Python.

Ironicly, this article is very mis-timed, it might have been a bit more accurate a couple of years ago before the recent perl resurgance kicked in, but right now it's looking out of date and ill-informed within 24 hours - You don't even have this years version of Tim Bunces Slides..

I'd suggest you stop pretending nothing happened in the Perl world since 2004, as you seem to have missed the release of perl 5.10, and recent developments like PSGI/Plack, Moose, Padre, etc.

I just had a quick peak at some job stats, and even with Perl being hit disproportionately by large IT layoffs in the banking sector, it still has more jobs and higher salaries than Python.

http://new.jobstats.co.uk/salary-rates/perl-jobs
vs
http://new.jobstats.co.uk/salary-rates/python-jobs

or

http://www.itjobswatch.co.uk/jobs/uk/perl.do

vs

http://www.itjobswatch.co.uk/jobs/uk/python.do

Gordon said...

Firstly, Google Trends is meaningless. The following programming languagues have been showing a steady decline over time in Google Trends:

ASP.NET
C++
Delphi
Java
JavaScript
Lisp
PHP
Python
Ruby on Rails
Visual Basic

In fact I was hard-pressed to find any language at all that had an increasing slope in Google Trend. I found a few that were pretty much staying level, like Erlang and Scala, but none that seemed to increase.

Secondly, PHP has namespaces and closures as of version 5.3. I've started using them myself in my PHP projects and I rather enjoy them.

Mark Atwood said...

I think that Perl also started losing out due to lacks of basic welcoming and civility.

In the late 90s I worked in a Perl-only shop. Exciting times. Perl 5 had just come out, and Perl skills were in rising demand. People were helpful to each other.

Jump forward 7 or so years, and I started doing some Perl programming again. I had a question, and I went to Perl IRC network, found the right channel, and asked my question.

All I got was snark, insults, and several "clever" answers that, while factually correct, were intentionally useless.

"Screw this," I thought. "It's time to learn Python."

Daddy said...

(I work with Martin; please be aware of past history.)

First Python being "more powerful". HAH. What an absolutely bizarre thing to assert. I can't see how either could be more powerful than the other. They operate in the same space and are Turing complete.

Well, it seems your HN post wasn't enough. You don't like Perl. Not liking Perl doesn't mean it's dead or worse than language X or Y.

Instead of harping on Perl, why not write some of your own code? Why not get together with our Russian friend here and help teach Python to others here. I'll go. I'd like to learn.

That being said, WRITE SOME CODE. Write some awesome Python code. Write some code that scratches your itches. Write some code that makes you happy... and forgot about Perl. It's not for you, that's fine, but it ain't hurting you by existing nor the existence of people that like it. We'll just continue on our way doing what we do... cause you know, we like it.

Anonymous said...

Yes, perhaps there are more parts of the grammar to learn, but there are parts that suit your style so you learn them and you're done with it.

Unless you ever have to maintain anyone else's code, in which case you have to learn the entire blasted thing.

I once inherited a bunch of Perl scripts from different authors. The TMTOWTDI attitude was the bane of my damn life.

Anonymous said...

Jeremiah, regarding your comment of "Yes, perhaps there are more parts of the grammar to learn, but there are parts that suit your style so you learn them and you're done with it."

Hah.

This sounds painfully naive and innocent. I don't think I've ever worked on a serious software project (after grad school, I mean) where I was the only person writing the code. My experience with programming -- of any sort -- is that I'm working with a large code base written by other people, and I have to understand it and make appropriate changes to it.

If I only knew a third of the grammar of the languages I was working with, I'd be lost just trying to understand what was going on, even if I did know enough to write complete a program from scratch. And even if I could read it, if I can't effectively add to it without rewriting it in "my" dialect, I'm wasting my time and causing unnecessary code churn.

(I don't have an opinion on the larger issue; I just wanted to point out the problem in that particular line of argument.)

I would also note, just for amusement value, that your comments about who Perl is developing much faster than Python et cetera sound exactly like the sorts of comments I'd make about Fortran with respect to C. Make of that what you will. :)

Anonymous said...

http://isperldeadyet.com

He's dead, Jim.

Siva said...

Ease of use is there with perl but readability is poor. "$" irritates and confuses code in perl and php.

python documentation not straight forward. lot of learning curve

ruby is ok. again one more to adopt without proper libraries??? i can't read more.

i need ways to develop rapid web apps in perl. i fancy writing a book on clean OOP perl.

all ur opinions appreciated.

Schoenobates said...

I really don't think Perl is on the decline. If anything, Perl is the glue that holds much of the IT world together and will continue to do so for some time.

We use it for all sorts of admin tasks as well as a few in house applications. In addition, Perl is one of the most useful applications for data mining in the biotech industry; again acting as the glue for a whole host of applications.

IMHO posts such as these really don't help anyone - it's not particularly objective but rather subjective.

Rick said...

I for one thank Perl for blazing the trail it did.

But really, Python (and maybe Ruby, I don't know about that one firsthand) are much easier to work with. And you can read code someone else wrote, too.

So.... I hope people stop writing Perl soon. It's time it took it's rightful spot beside COBOL and soon C++.

Rick

Unknown said...

>>Its table of operators can only be described by "gargantuan"

That operator table was about Perl6, not 5! A very different language.

It seems like typical troll bait when you obviously don't even verify that your references are about the right language!

(Ovid etc have already discussed TIOBE.)

A serious discussion on the subject would e.g. compare Moose to Python's inferior OO system.

This kind of argument is what seems to generate most of the "not dead" defensive replies from Perl people -- which you in turn use as proof Perl 5 is dying.

If you have to try generating FUD, at least make it better... if you can?

Anonymous said...

@user120:

"i need ways to develop rapid web apps in perl."

You need CGI::Application's evolution Titanium. It works a treat :-)

ric said...

Learning Perl should be a "rite of passage" to all serious programmers out there along with C/C++ and Lisp or Haskell and Python. Once you know Perl, you can easily pick up PHP and you will better understand many of the constructs in Ruby which have been borrowed from Perl. It shouldn't be a mutually exclusive thing... No language is always better than other languages, each having their own sweet spot so it pretty much depends on the application and the skills and knowledge of your programming team. You won't really reach programming enlightenment until you understand this.