PHP vs Perl what would you pick and why?

Discussion in 'PHP' started by infocollective, Oct 4, 2008.

  1. #1
    Hello i am new to the forum, but i noticed there is no Perl section. I am a very good Perl programmer (atleast i would like to think so) but i would like to know which one you would think is better. I am not trying to start fights just am genuinley interested. Thanks guys
     
    infocollective, Oct 4, 2008 IP
  2. SeanBlue

    SeanBlue Peon

    Messages:
    110
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I haven't used perl though alot of oldschoolers prefer it. PHP is certainly alot more popular and wide spread, but of course it uses some of perls functions as its own.

    As to which is better, I wouldn't know. I would say though that most programming languages are designed for a specific purpose and so you can't really say one is better than another.
     
    SeanBlue, Oct 4, 2008 IP
  3. bm_ys

    bm_ys Well-Known Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    #3
    Phyton > Asp.net > Perl > PHP i think

    the speed of programming language depends on how much sourcecode compiled so if you don't use php accelerator on your server the php has the worst speed.

    The syntax of programming language doesn't have any affect on speed of program. if you want which one is best for syntax i think the order is
    php > asp.net > perl> phyton

    and i dont have any idea abaut, another language called ruby.
     
    bm_ys, Oct 5, 2008 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Perl has a speed edge on some things, PHP on others. Perl is a hair faster on everything except interfacing to an SQL database.

    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=perl&lang2=php

    Python is faster executing flat code
    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=php

    Though if you have a caching accellerator for php it can be faster than either at multiple requests levelling the playing field - this is where PHP wins (though there are no benchmarks for multiple requests)- assuming you have the memory to burn as cache. Without something like Memcached or eAccellerator installed, php is slower at executing variable handling or logic flow... though it is faster at serving static content (anything you echo or don't put inside <?php - like most of a website) much less the more robust handling of HTTP headers, ability to cache it's own output, and even control gzipping the output. The DBI module for perl is slower and kludgier than the built in interfaces php has to various SQL databases, one of the reasons php supplanted PERL for new applications.

    In terms of speed Ruby isn't even in the running - though it's better at not hogging RAM.
    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=ruby&lang2=php

    Though let's put that speed and memory use into a frame of reference:
    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=fbasic&lang2=python
    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=gcc&lang2=python
    http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=fpascal&lang2=python

    Insulting when Basic kicks yer posterior - but it proves there's more to programming than speed. There's also ease of coding, ease of maintennance, and ability to interface with other programs (like apache)

    Though I've been playing with the idea of trying to use FPC to make a CMS - just out of morbid curiousity.
     
    deathshadow, Oct 5, 2008 IP
  5. happpy

    happpy Well-Known Member

    Messages:
    926
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    120
    #5
    php - easy syntax, lots of functions out of the box, every host supports
     
    happpy, Oct 5, 2008 IP
  6. bm_ys

    bm_ys Well-Known Member

    Messages:
    112
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    131
    #6
    you are right , while the servers get stronger and have much memory , programmers don't notice the speed of programming language. i preffer slower php to fast phyton bacuse of easy syntax.
     
    bm_ys, Oct 5, 2008 IP
  7. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #7
    If I were to start over again knowing what I know now, probably Perl.

    I'm a preg_* nut.
     
    joebert, Oct 5, 2008 IP