LWN.net Logo

On the future of Perl 5

On the future of Perl 5

Posted Dec 3, 2008 16:16 UTC (Wed) by orev (subscriber, #50902)
In reply to: On the future of Perl 5 by kragil
Parent article: On the future of Perl 5

No, bad Perl programmers write hideous write-once programs in it. That's a byproduct of how flexible Perl is. But you could say the same thing about C, C++, Java, etc... Anyone can write a program that is hard to maintain in any language.

A huge majority of "programs" on most Linux distros are actually scripts, and Perl scripts at that. Removing it would take a herculean effort.


(Log in to post comments)

On the future of Perl 5

Posted Dec 3, 2008 19:10 UTC (Wed) by sbergman27 (guest, #10767) [Link]

I just spot checked a Fedora 8 box, and in /usr/bin and /usr/sbin, there are 2706 executables. 580 of those are scripts. 142 are perl scripts. So it's really more along the lines of about 5% of "programs" being perl scripts, and less than 25% of scripts being perl scripts. Also, I would imagine that the perl scripts would mostly fall under the category of command line utilities as opposed to full-blown programs, and would thus be easier to port to, say, Python.

What in the world made you think that 'A huge majority of "programs" on most Linux distros are actually scripts, and Perl scripts at that', BTW?

On the future of Perl 5

Posted Dec 4, 2008 0:05 UTC (Thu) by njs (guest, #40338) [Link]

> Anyone can write a program that is hard to maintain in any language.

I used to be a huge perl fan and made exactly this argument all the time. Then I noticed that, while it's true that one *can* write beautiful code in any language, if you look at the code that people actually *do* write, the actual average readability varies a huge amount between languages (and this is just as true for expert code as for quick-hack beginner code).

Arguments from absolutes, can vs. can't, are philosophically comforting; but in practice percentages matter at a lot.

On the future of Perl 5

Posted Dec 4, 2008 20:22 UTC (Thu) by elanthis (guest, #6227) [Link]

Unless you fail to understand what the percentages mean. :) Reminds me of how people keep claiming that PC games are dying because the percentage of PC sales vs console sales keeps shrinking, despite the fact that PC games are making more money year after year... statistics are useless if you don't analyze them intelligently.

The amount of bad code a language is going to have can be highly dependent on the language's popularity with novice and hobbyist programmers. Take JavaScript, for example. Almost every last single bit of JavaScript I've seen in real projects has been absolutely atrocious. Most of it actually breaks the rules that JavaScript implies, and ends up resulting in bugs that are not the language's fault.

It's a symptom of the fact that there are millions of people writing JavaScript code that have not a single ounce of real computer science software engineering education.

The same tends to be true for Perl in terms of UNIX/Linux scripting. It's the language-of-choice for users in that environment who need to hack together some quick something-er-other, so you get a lot of unskilled folks putting together crappy code because they don't know any better.

The worst thing that you could say about Perl is that its syntax makes it possible for unskilled programmers to write very ugly code, while other languages make it difficult for unskilled programmers to do anything without first learning a bunch of concepts and uncompromising syntax rules. Python, touted as an oh-so easy language, requires a user to learn more; you must understand OOP, scoping, function calls, variables, etc. to get anything done. In Perl, you can get an amazing amount done without understanding much at all.

On the future of Perl 5

Posted Dec 4, 2008 20:51 UTC (Thu) by njs (guest, #40338) [Link]

Well, yes, perl attracts beginner programmers. (Let's put aside for the moment whether python, originally designed as a first language for newbies, does the same.) But that's not what I'm talking about, which is why *I already said* that IME, expert code is also uglier on average in perl than, say, python.

My claim is simply this: in perl the path of least resistance is ugly code. That doesn't contradict your point: if your strength of will never falters then you can resist this and indeed, produce uniformly beautiful code - we agree. But, contrary to geek standard philosophy, real humans are not perfect rational agents. I have my moments of weakness. I suspect you do too. Can you really say you never succumb to temptation against your better judgement? Humans are messy critters, and ignoring that feels good but it doesn't actually help; we do better to admit it, study it, and design our systems to support our strengths while de-emphasizing our weaknesses.

On the future of Perl 5

Posted Dec 6, 2008 16:46 UTC (Sat) by sbergman27 (guest, #10767) [Link]

"""
python, originally designed as a first language for newbies,
"""

To my knowledge Python was designed as a successor to ABC, and with practical goals in mind. Although it is often recommended as a first language, I do not believe that it was originally designed as one.

On the future of Perl 5

Posted Dec 7, 2008 0:27 UTC (Sun) by njs (guest, #40338) [Link]

Right, I was thinking of the "Computer programming for Everybody" computer literacy initiative that got Python DARPA funding in early years; it looks like the history is more complicated than I implied, though.

On the future of Perl 5

Posted Dec 5, 2008 0:47 UTC (Fri) by johnkarp (subscriber, #39285) [Link]

Personally, I found it much easier to learn Python than Perl. I learned largely by reading existing programs. The bizarre use of punctuation, umpteen ways to write a conditional statement, and shuffling with 'shift' and '$_' are all somewhat offputting. In contrast, python reads like psuedocode in an algorithms textbook.

(I do end up using perl more than python at the moment, though I'd use ruby if that were supported where I worked.)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds