Slashdot Mirror


Perl's Glory Days Are Behind It, But It Isn't Going Anywhere

snydeq writes "Deep End's Paul Venezia waxes philosophical about Perl stagnancy in IT. 'A massive number of tools and projects still make the most out of the language. But it's hard to see Perl regaining its former glory without a dramatic turnaround in the near term. As more time goes by, Perl will likely continue to decline in popularity and cement its growing status as a somewhat arcane and archaic language, especially as compared to newer, more lithe options. Perhaps that's OK. Perl has been an instrumental part of the innovation and technological advancements of the last two decades, and it's served as a catalyst for a significant number of other languages that have contributed heavily to the programming world in general.'"

14 of 379 comments (clear)

  1. Wait, what? by girlintraining · · Score: 5, Insightful

    So let me get this straight: A programming language that found a niche, became massively popular, and is now widely used... is a failure in your eyes because it's not in a constant state of change?

    You're kidding, right? The epitome of a successful programming language is that it has become flexible enough to meet the needs of its users without requiring more than maintenance fixes. This is like saying "grep is useless because nobody's completely redesigned in in the last few months!" Dude, stop drinking the Web 2.0 kool-aid. There are things in the computer world that aren't meant to change every day. I know it's hard to imagine when every pundit is screaming "release early, release often" from every rooftop, but speaking from experience... If you go mangling your programming language every few months like (cough, .NET) some companies do, you're going to find your developers bailing out like rats from a sinking ship.

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:Wait, what? by LordLucless · · Score: 4, Insightful

      So let me get this straight: A programming language that found a niche, became massively popular, and is now widely used... is a failure in your eyes because it's not in a constant state of change?

      Uh, no, that'd be you putting words into the writer's mouth. How about this:

      As more time goes by, Perl will likely continue to decline in popularity and cement its growing status as a somewhat arcane and archaic language, especially as compared to newer, more lithe options.

      It's not failing because it's not changing, it's failing because less people are using it. The lack of it integrating shiny new features may be one of the factors contributing to this.

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
    2. Re:Wait, what? by girlintraining · · Score: 5, Interesting

      Perhaps a few mandatory rules could fix this problem? Doubt it though because it seems PERL programmers seem to value code over hardware..

      You're blaming poor programming on the language. Perl isn't meant to be a replacement for, say, C, but considering its an interpreted language, running at 1/56th speed of compiled code is not bad. The author here mentions PHP, Ruby, and Python. A separate analysis reveals that PHP is worse. The others are only marginally better because they have a specific function by that particular benchmark test optimized. A separate and equally simple benchmark has Perl on top. I'm sure many will be able to come up with more comprehensive benchmarks, and then a flamewar will erupt... But my point (soon to be lost forever in the ensuing tsunami of replies) is that the usage scenario determines language performance, and in many usage scenarios, Perl is the winner amongst the author's picks. Don't blame the language because the programmer either (a) uses it incorrectly or (b) uses it for something other than it was designed for. Perl is fundamentally about string manipulation and I/O between various datasets and is a high-level language. If you aren't using it for that, you're doing it wrong. Not to say it won't work... but it's not the Right Thing.

      --
      #fuckbeta #iamslashdot #dicemustdie
    3. Re:Wait, what? by girlintraining · · Score: 5, Interesting

      It's not failing because it's not changing, it's failing because less people are using it.

      Compared to the alternatives the author suggests? Ruby and Python combined are doing less than Perl. PHP is the runaway favorite, but if you dig into the numbers, you'll find that most of the change is due to Content Management Systems which by and far have been developed on PHP. So these massive zomfg numbers PHP is pulling in isn't due to people programming with it as much as they are copy-pasting it en masse.

      Perl is often custom back-end stuff with little visibility. It runs in cron jobs. It happily links various back-end pieces to one another... doing its unglamorous jobs with ease. Yes, Ruby is pretty and shiny. Yes, Python is a hot thing right now. But I've developed for all of them, and you know what? Perl is still what I'd turn to for back-end work over either of them because it's easy to work with and in many use scenarios I encounter professionally... faster as well. Python starts to choke (badly) in a take-down-the-server kind of way when it gets taxed. Ruby is the same way. But Perl seems bulletproof... even in a resource-constrained environment, it just. doesn't. die.

      And for me, writing code for corporate use... Reliability trumps shiny any day of the week.

      --
      #fuckbeta #iamslashdot #dicemustdie
    4. Re:Wait, what? by solidraven · · Score: 5, Insightful

      No, you look at Perl in the wrong way! The camel is good at what it's designed for. It won't do it neatly but it'll get the job done. Need to hack two incompatible systems together quickly? Perl is there for you. Need low level access from a scripting language? Perl fills the gap. And in terms of performance the old camel still gives a lot of new "optimized" languages a run for their money. It's also one of the most flexible languages out there. Name a few other scripting languages that are used on such a wide range of systems? You'll encounter Perl on the small embedded systems and on large clusters. It simply adapts to the task at hand. It's sort of like Fortran and Ada in that, many people are against it but those who are familiar with it know what it's capable off aren't going to drop it cause it looks ugly to the younger programmers.

      In case you're wondering Fortran is the best data crunching language out there and Ada is in a league of its own when it comes to reliability. Idealism doesn't have a place in engineering, you use the right tool for the job and stop whining about how easy it is to use or master.

    5. Re:Wait, what? by Anonymous Coward · · Score: 4, Informative

      I'd still say they don't have an easy regex.

      Perl's is an actual operator in the language, all other languages require you to build and use a regex object... which means 1 line in perl requires more lines (define+create, then test) in others to do the same.

    6. Re:Wait, what? by ThePhilips · · Score: 4, Insightful

      That is excellent. Considering that that particular benchmark is arithmetical and Perl has nearly zero optimizations for the arithmetic.

      --
      All hope abandon ye who enter here.
    7. Re:Wait, what? by Tridus · · Score: 4, Insightful

      That "bloody whitespace" is one of the reasons your average python code is more readable than your average perl code. You don't see a lot of python code that should actually be 30 lines but is crammed into one because the developer though that line breaks are some kind of precious resource.

      --
      -- "So they told me that using the download page to download something was not something they anticipated." - Bill Gates
    8. Re:Wait, what? by arielCo · · Score: 4, Insightful

      $foo is one (scalar) variable, which is not the same as @foo (array), and %foo (hash) and foo (file handle), which can coexist without interference, and no Perl programmer will be confused by that (we actually think of the sigil as *part* of the name, as in "dollar foo" and "percent foo"). So it's not redundant syntax, which Perl avoids like the plague.

      They're also there to ensure that you're getting the right kind of value when you build an expression, like @stooges = @people{('curly','larry','moe')} (stooges is an array, people is a hash). That is the kind of compact syntax that makes it popular as opposed to iterating over the keys to add the values to the array.

      --
      This post contains no rudeness or derision of any kind. All arguments are friendly. Terms and exclusions may apply.
    9. Re:Wait, what? by spxZA · · Score: 5, Informative

      In my third year of varsity, we had to write a search engine with indexing stored in files. My Perl solution returned results twice as fast (averaging 22ms/query) as any other in the class, most of which were C or C++. And it took me half the time to write.
      I love Perl mainly because of I am a lazy programmer. Yes, most of my Perl scripts take a little bit longer to execute, but we're talking a difference of seconds or minutes, not hours. There are times where I choose Perl, Python, C/C++, PHP, etc, but this depends entirely on the problem and the circumstances. I will use Perl until I die, even if there aren't any more releases from now on.
      Should we lament Bash for the same reasons? The last release (4.2) was 13 Feb 2011, and the last feature release (4.0) in early 2010. ZOMG!

    10. Re:Wait, what? by muon-catalyzed · · Score: 4, Funny

      >You are not supposed to understand the code

      Right, that is because Perl is the only language whose code looks the same before and after RSA encryption.

  2. Re:Perl for sysadmins by guacamole · · Score: 5, Interesting

    Perl is certainly right for sysadmins. First, Perl borrows heavily the ideas/syntax/cues from the standard unix shell scripting. I am talking about writing scripts with bash, awk, sed, grep, find, tr, etc. If you know them, you will fee right at home. Perl glues the ideas of all of these tools together into a more consistent syntax, and runs much faster than the speed most shell scripts could ever achieve.

    Another important issue is the community. Perl community is filled with people who do system administration (not that there aren't other users of perl), so there are tons of libraries, which are available to use as easily as starting Perl's CPAN shell and having it install them automatically. The best book to learn Perl is Larry Walls "Programming Perl". A new edition just came out.

    Having said this, I want to mention a that it's a good idea to develop a good sense of judgement. For example, I always got annoyed by some fanboyish coworkers who wrote Perl scripts when a simple shell script would suffice. I have seen perl scripts that are filled with calls to external shell commands, cp and rm and so on which I thought was stupid. (Need a shell script? just write a shell script). And I still loving using awk and similar tools for writing most of "one-liners". I always found awk to be a bit better suited for that than perl. On the other hand, know when to start writing Perl script instead of shell script. Shell scripts can get clumsy very fast.

    Another advise, you may also want to check out Python. I was a Perl person, and recently looked into Python, and lo an behold, I am very impressed. In my opinion Python sets a new standard in cleanness and readability. Take a look at the free book "Dive into Python" as well as the official Python 3 tutorial online. Both are short and can be covered in just a few study sessions. Still, in sysadmin world Perl may be more useful, but Python is a great all-around general purpose language.

    To see what I mean, take a look at this discussion

    http://stackoverflow.com/questions/3775413/what-is-the-perl-version-of-a-python-iterator

    compare the tidy Python code at the top with the proposed Perl solutions below.

    Finally, the most striking tool I have used when working as a sysadmin was CFengine. It's the bomb try it. It's a very high level declarative programming language for managing large sites/infrastructures.

  3. What is Perl? by prefec2 · · Score: 4, Insightful

    Perl is a historically a combination of bash, awk and sed. And for purposes well suited where people would use the former three tools to implement shell scripts to help administration tasks on a daily basis. However, Perl is not so well suited for other purposes, like small and medium sized web applications. Therefore, it will not gain any more ground in that area, as better tools are available. The first Perl enemy was PHP. While PHP sucks in many ways, it was better designed to write simple dynamic web pages. Today it is used for medium sized web applications, which is clearly a dangerous thing, but still it restricts the growth of Perl in that direction, as younger coders came first in contact with PHP and all the hosters support PHP, but not everyone is supporting Perl. Also things like Joomla or Typo3 are PHP based and many people start coding by extending them.

    For custom application or other mostly larger system Java-based or .NET-based technologies are used. Perl has nothing to do in that area. It lost its job there many years ago. InterShop was once coded in Perl, but - well - who cares?

    As the Unix command shell is only a limited realm (in number of installations), Perl will never become that widespread again. At least that is my assumption considering today software base and structure, as well as the education in programming languages.

  4. Language Design by YojimboJango · · Score: 5, Interesting

    I wrote this a while ago, but I find it's useful to post it here:

    The precondition that you can write terrible code in any language is a mental diversion. You must design languages for people that believe in intelligent design.
    If there is low hanging fruit in your garden of eden, people are going to assume that someone vastly smarter then they are placed it there for plucking.
    Not even God himself coming down from on high and face to face telling every member of the human race not to touch it is going to keep it from being abused.
    That is the true nature of humanity and by inclusion programmers.

    perl: An unorganized, but sprawling garden full of almost every imaginable fruit. Regex is a shiny sinful apple at eye level on every single tree. The only way to navigate the garden is to ask the snakes.
    python: An organized garden that has one of each kind of fruit. But it's half way through being dug up and replanted into an even more organized garden.
    ruby: A newer garden. Heaps of fertilizer make everything grow incredibly fast, but the trees are getting tangled and there's a problem with weeds.
    c#: Someone spent a lot of money crafting this garden correctly. They also planted trees that emit a hypnotic pollen that will murder you if you try to leave the garden.
    java: A beautiful garden but only when viewed from space. Every tree has exactly 1 fruit, and getting anywhere takes forever. Recently taken over by someone interested in c#'s hypnotic pollen trees.
    c++: An industrial farm complete with tractors and combine harvesters, but no safety equipment. As a bonus 98% of the farm does not contain buried land mines.
    c: A plot of land and a barn full of seeds. Get to work.
    javascript: There's only 1 tree and it grows upside down, but you can find it resurfacing in all the other gardens. It's also sentient, growing rapidly, and trying to murder you.