Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

petdance (2468)

petdance
  andy@petdance.com
http://www.perlbuzz.com/
AOL IM: petdance (Add Buddy, Send Message)
Yahoo! ID: petdance (Add User, Send Message)
Jabber: petdance@gmail.com

I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.

Journal of petdance (2468)

Wednesday October 19, 2005
10:56 PM

Call for TPF volunteers: I know PHP, why should I use Perl?

[ #27252 ]

I went to the Chicago PHP User Group today, and I talked about project tracking. Afterwards, I chatted a bit about TPF, and I was asked "I already know PHP, why should I use Perl?"

That's a question that I want us as TPF to be able to answer, in ready form for people to refer to. I want one of you, out in the Perl community, to work with me to write the set of pages that answer that question.

If you would like to work on this project, please email at andy at perl.org and let me know. This will be a writing project, not an HTML project, so don't worry about web chops.

I welcome your comments here in this entry, too. They may give us ideas that we can use in the final pages. Note that the question is not "Why is Perl better than PHP", but rather "Why should I use it?" The former question is purely a mental exercise, and the latter is a pragmatic one.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Note that the question is not "Why is Perl better than PHP", but rather "Why should I use it?"

    Off the top of my head:

    1. Perl is used in places that PHP isn't. You'll find Perl applications everywhere from unix system administration to car parking. Learning Perl gives you the opportunity to work in more places doing different things.
    2. In many cases somebody else has written most of your application for you. CPAN is a stupidly useful resource.
    3. All languages make some things easier and some things harder.
    • (Attempting to channel a recalcitrant, skeptical PHP programmer....)

      Perl is used in places that PHP isn't. You'll find Perl applications everywhere from unix system administration to car parking. Learning Perl gives you the opportunity to work in more places doing different things.

      That's fine, but why should I care? I'm never going to use a Sequent, port my application to AIX 4 or DYNIX. It's nice that sysadmins can use Perl, but if I don't care about writing sysadmin scripts, what's the point?

      • Yes, exactly. These questions are the ones that we need to anticipate in writing this. We need to explain the tangible benefits, not the soft fuzzy ones.
        --

        --
        xoa

      • I noticed you addressed points 1 and 3, but not point 2. I notice also that point 2 has the best chance of achieving the ">33% increase in productivity" someone else mentioned.

        Also, if there are any benefits from Perl (or any other language), why should I be the one who wastes my time learning Perl with the explicit purpose of not using it?

        Not answering the question of why, but the idea of learning things you won't use doesn't exist (much) since you can learn a minimal subset of Perl easily and in

        --
        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • I noticed you addressed points 1 and 3, but not point 2. I notice also that point 2 has the best chance of achieving the ">33% increase in productivity" someone else mentioned.

          The benefits and drawbacks of CPAN are well known. And, as a devil's advocate, my point isn't to be Mr. Internet Politics Debater and natter on with "you're wrong and here's why", but to highlight some flaws in your argument that need to be addressed.

          Not answering the question of why, but the idea of learning things you

          • It was Adrian's argument, not mine, and I was just trying to point out that CPAN was definitely a selling point that couldn't be spoken against.
            --
            J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
      • Responding to the recalcitrant, sceptical PHP programmer rather than ziggy :-)

        That's fine, but why should I care? I'm never going to use a Sequent, port my application to AIX 4 or DYNIX. It's nice that sysadmins can use Perl, but if I don't care about writing sysadmin scripts, what's the point?

        None.

        Let me be clear. I'm not trying to say "you should drop PHP and use Perl". I'm saying "here are some reasons you should consider learning Perl as well".

        If none of them apply, then don't learn Perl. Does

        • (still channelling the recalcitrant, sceptical PHP programmer...)

          Learning more programming languages can only make you more employable. If your concentrating on web development targeting the other primary language used for web development would seem sensible.

          Your defending the argument with still more platitudes. Specifically, you're making a generalized argument that PHP programmers should learn more languages, but you're not saying anything specific about why PHP programmers should learn Perl. (

          • (still responding to the recalcitrant, sceptical PHP programmer...)

            Your defending the argument with still more platitudes. Specifically, you're making a generalized argument that PHP programmers should learn more languages, but you're not saying anything specific about why PHP programmers should learn Perl

            I thought the "targeting the other primary language used for web development" was fairly specific :-)

            In fact, it really highlights that you should just skip Perl/HOP and jump straight into Scheme/

  • I like to point to my experience with PHP [perl.org] as why I shy away from it. But that's simply not good enough - I mean, anyone can write insecure code with any language.

    I'm not sure this is a worthy project. IMO, we need to get programmers good at what they do. KISS (Keep It Secure, Stupid!). Converting them to a new language resets their capabilities instead of getting them closer to writing that killer app.

    Peace,

    Jason
    • I mean, anyone can write insecure code with any language.

      Although Perl makes it very easy to NOT write insecure code by using taint mode. That's a huge bonus over PHP.

      We'll be sure to put taint mode on the list.

      --

      --
      xoa

      • Yeah, that was my initial thought, too, but put yourself in the shoes of a PHP programmer. They just want to hack something quick to get the job done. Taint mode adds complexity to the task at hand.

        And I'm sure there's something similiar that can be done in PHP (register_globals, etc).

        IMHO, the clincher is CPAN (though PHP has PEAR -- odd their latest news [php.net] is >1y old, though -- maybe PHP uses something else?). With CPAN, a Perl Web programmer can design/code from a high level and look for CPAN modules
        • put yourself in the shoes of a PHP programmer. They just want to hack something quick to get the job done.

          That's far too broad of a brush. Just in the room of a dozen PHP folks last night, there were two camps. There were the people in the "I just want something quick to get it done" group, as you suspect, and there was the "PHP was what I learned years ago, and I've never seen a reason to change" group. It's this latter group that I'm most concerned with.

          --

          --
          xoa

          • Though I have not used this and dont know much , using Php::Interpretor [cpan.org]php folks get access to CPAN modules so that is a good reason
          • ... there was the "PHP was what I learned years ago, and I've never seen a reason to change" group. It's this group that I'm most concerned with.

            Should they change because we want more people at our dinner party, or because they can get more stuff done? Every argument I've heard over the years has been on the dinner party side -- whether the targeted hacker uses Java, PHP, Python, Ruby, Tcl, or C++.

            Paraphrasing one of my favorite Twilight Zone episodes from the 1980s, the one thing that will get a

            • So if I were a PHP programmer who wanted a compelling reason to change, I'd be looking for something that allowed me to do things that are simply impossible in PHP, or make me >33% more productive.

              Yes, I agree. That's exactly what I'm aiming for on this.

              --

              --
              xoa

        • Yeah, that was my initial thought, too, but put yourself in the shoes of a PHP programmer. They just want to hack something quick to get the job done. Taint mode adds complexity to the task at hand.

          Ick. I would never want anyone working for me to have the idea that taint mode adds too much complexity to a web app.

          --
          J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
  • Many web service providers do not allow user perl scripts in a shared-user environment. Any argument for using perl over PHP has to address the tools people have available from the companies they are comforable working with...
    --

    -DA [coder.com]

  • There are plenty of successful VisualBasic programmers who do a great job creating applications for use on the Web and Desktop. They may know that C++ is more powerful, but most of them never need the low-level abilities that C++ allows. As a whole (especially given a Windows environment), VisualBasic is good enough for almost any job.

    I look at it this way:
    Perl is to C++ as PHP is to VisualBasic.

    PHP is probably the hardest group, as a whole, to convince. PHP is more specialized, which makes it easier