Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
go ahead... be a heretic
 
PerlMonks  

Re: Argument for Perl ( again and again )

by davido (Archbishop)
on Oct 17, 2012 at 18:34 UTC ( #999595=note: print w/ replies, xml ) Need Help??


in reply to Argument for Perl ( again and again )

Don't try to convince someone by trotting out a list of things you think make Perl cooler than other languages. Chances are good that the person who knows "other language" better than you will already know how to accomplish the same thing in a more "other-language-ish" way. Any Turing-complete language can find a way to achieve the same goal. Sure, more work goes into writing an HTML parser in C, but the C folks have undoubtedly accomplished it at some point along the way, and they may have actually invented something the rest of us could learn from.

...which brings me to the main point of my post: Other languages aren't the enemy. They're neighbors. They're influencers. They're co-innovators. Perl was born out of a desire to take some of the best ideas of other languages and combine them in a way that turned out even better. As soon as we dismiss another language as being a fool's errand we're no better than those who scoff at Perl, dismissing it because of some misguided, under-informed reasoning, and in so doing, missing out on some really cool things.

Perl moves forward when people bring fresh new ideas to it. Moose wasn't invented in the vacuum of a Perl-only world. It took some of the better features from other languages, invented a few of its own, and combined them all in a way that gives us one of the better object systems available to a multi-paradigm language. Regular expressions weren't a Perl invention. But PCRE has become the de-facto standard because Perl took some of the best Regex features, added some more cool ideas, stole a few cool ideas from other languages later on, and developed one of the richest, most powerful (and most difficult to master) regex syntaxes available. Perl's generic containers weren't a Perl-only phenomenon, even back in the 80's when Perl was invented. And more recently, Plack is an idea lifted directly from another language, and made our own.

What does this have to do with defending Perl? Well, if there's a point I'm trying to make, it's "Don't!". Instead, ask the individual if there's anything in Perl he thinks might provide inspiration for the betterment of his favorite language. Play to his interest in his own language. But above all, listen to what he has to say. We all benefit from an open dialogue, free from defensiveness.

As an example, C++ might actually be a better language if someone could just figure out how to give it anonymous subroutines and closures. C++11 did just that, and there are lessons we can learn from the C++11 implementation back here in the Perl world. This open dialogue thing is a two-way superhighway (or it should be).

If you want Perl to continue to move forward, don't defend it. Innovate. And encourage others outside of the Perl world to innovate as well. Furthermore, encourage others inside and outside of the Perl world to explore each others' languages, and bring the best things they find back to their own language. As we watch that evolution we'll learn some new tricks too.


Dave


Comment on Re: Argument for Perl ( again and again )
Re^2: Argument for Perl ( again and again )
by aaron_baugher (Deacon) on Oct 19, 2012 at 21:48 UTC
    Don't try to convince someone by trotting out a list of things you think make Perl cooler than other languages. Chances are good that the person who knows "other language" better than you will already know how to accomplish the same thing in a more "other-language-ish" way.

    That's a good point. And if he really cared about regexes and glue language, he'd already be using Perl. The fact that he thinks one regex implementation is as good as another tells me that a list of Perl's strengths just isn't going to impress him. (The fact that he used "easy" and "Java" in the same sentence makes me think I wouldn't try.) Perl isn't a buzzword language; a lot of what makes it special is hard to define.

    Take statement modifiers, for instance. At first glance, they may seem superfluous -- they don't let you do anything you couldn't already do with normal loops. But it's hard to describe how much they aid the process of reading and writing code (and how frustrating it is to switch to a language that doesn't have them). Similarly, it's hard to explain why =~s///g is so much better than preg_replace(), but it is. I think a lot of Perl is that way.

    Aaron B.
    Available for small or large Perl jobs; see my home node.

      I think the most successful tack is the one that encourages someone to investigate, not because "mine is better", but because "different is enlightening." Here's a quote I happen to like:

      Thoughtlessly applying techniques effective in one language to another typically leads to awkward, poorly performing, and hard-to-maintain code. Such code is also most frustrating to write because every line of code and every compiler error message reminds the programmer that the language used differs from “the old language.” ...Every language can be a fertile source of ideas... However, ideas must be transformed into something that fits well with the general structure of [the new language] in order to be effective in the different context.

      – Bjarne Stroustrup The C++ Programming Language, Special Edition.

      (Emphasis added.)

      My feeling is that most of the time when people are quick to dismiss another language it's because they haven't learned enough from it to get past the stage of "thoughtlessly applying techniques effective in one language to another", and are frustrated because "every line of code and every compliler error message reminds the programmer that the language used differs...". Given a chance, most languages have at least something to offer. I think Perl has a lot to offer to those who are willing to work past the awkward stage.


      Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-04-20 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls