in reply to Perl vs. PHP

Altho I was considering not replying, here goes...(Adding my 0.02 Eurocents in the flamewar)

PHP, IMHO, is oki for quick layouts, vague DB stuff and lite code. It is, however, no match for Perl.

The abstraction layer Perl has with DBI (not DBD::DBI as you noted) is unfound in PHP. Every RDBMS in PHP has it's own function for querying, connecting etc (thus making portability rather difficult). The PHP syntax is based heavily on Perl but I fear some more powerfull functionality has been dropped.

The fact that hashes and arrays are one and the same, the fact that both scalars and arrays/hashes are accessible thru $ (bye bye % and @) makes it a bit weird if you're making the step. The power Perl has lies in the fact that you can have a plain console tool and port it to CGI in a matter of minutes (if you're used to doing that stuff). I acknowledge PHP has PEAR but it doesn't have the diversity CPAN has. Ofcourse Perl has an advantage of several years but Perl also has the advantage of being multipurpose, a step PHP only recently took by doing GTK+ functionality. I also feel that the core functions provided in PHP are too numerous. Considering the speed claim... PHP is an Apache module. mod_perl runs as fast, even faster than PHP. PHP can be run as CGIs too and I'm sure Perl beats it at that too. What about the embedding? Perl has embed solutions too, several actually.

Rasmus and his team do deserve the attention PHP is getting, since it's fun, easy and flexible and they did a great job designing the language. But for some reason EVERY PHP programmer I know claims Perl is not as good as PHP. For some other reason, EVERY PHP programmer I know who wants to take that extra step in his programming career, switches to Perl and doesn't look back.

End Remark: It's not in the language, it's in the programming style. Every programming language has it's strength and it's weaknesses. Perl is powerfull at this, PHP at that. If we all stopped bickering for a second ...

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Perl vs. PHP
by ignatz (Vicar) on May 20, 2002 at 21:09 UTC
    > ... and they did a great job designing the language.

    Gahh!!! /me pulls on hair screaming.

    Puuuuhhhhleeeze. My favorite "design" in php is their well thought out naming conventions for standard functions such as always abreviating string as str, oh... that is except when it's abreviated as strn or good ol' fashioned string, and of course the underscore, underscore, who's got the underscore game that you have to play with every method.

    If the million monkeys jumping up and down on typewriters came out with a programming language, it would be closest to PHP.

    /me goes back to working on his submission for PEAR.

    ()-()
     \"/
      `                                                     
    

      Not to claim that I know anything about PHP (I don't), but I have dim memories of C (and I just took a look at your links), and I will indulge in one smart-ass nit-pick: if you're confusing strcmp and strncmp, you may be in for a nasty surprise... that 'n' isn't part "string", it's an integer argument to the function telling it how many characters are significant for purposes of this comparison (that is, strncmp("bar","baz",2) indicates no difference).



      If God had meant us to fly, he would *never* have given us the railroads.
          --Michael Flanders

        Ahhh, Nobel Chem Lad, you have foiled my argument well. You are indeed correct as to PHP's dusty lineage. The fact that it would be very easy for them to simply overload strcmp for the third parameter to make a clean, consistant and simpler naming scheme unfortunately in no way adds to the humor of my erroneous attempt at mirth.
        ()-()
         \"/
          `