in reply to Perl/CGI Vs PHP Vs ASP

The speed issues notwithstanding, I don't read anything about your project that would specifically preclude any of the three languages you mention. Large e-commerce sites have been built in all three. I think, in the final analysis, it comes down to personal experience and your own programming "personality." Here's a few thoughts I have:

I have at least a few problems with ASP: 1) it does not meet my requirement of separating executable code from HTML, 2) it is exclusively Microsoft (there are crossover methods like Apache::ASP and Sun's Chilisoft) 3) I'd have to learn VB (too much like the old days).

I have pretty much avoided PHP because: 1) it does not meet my requirement of separating executable code from HTML, 2) lack of 'strickness', 3) too many words--there is a function for *everything*, 4) see the Update from this thread as well as the rest of the discussion.

I like Perl because 1) I know it (fortunately I chose correctly when I decided to learn a server-side language for my web work), 2) it requires me to be a careful programmer (programming has become a hobby for me), 3) and oh...the CPAN modules (I amazed at how a few lines of OO code can eliminate reams of my code and all the headaches), 4) you won't find better support than the Monastery.

The only issue that concerns me about pure Perl/CGI is the overhead, but apparently, though I have never used it and know little about it, mod_perl addresses that.

Whatever you end up using, make sure it is safe, structured, 'strict', uses best practices, and well documented. That will make up a lot of the minuses of any language. Better well-written PHP than poorly written Perl--at least in principle.

PS: Another insightful overview.


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Replies are listed 'Best First'.
Re^2: Perl/CGI Vs PHP Vs ASP
by weierophinney (Pilgrim) on May 22, 2005 at 02:35 UTC
    As someone who uses both PHP and perl on a daily basis, I feel the need to point out some bad assumptions here.

    First, your reasons for avoiding PHP are based on some flawed assumptions. Regarding (1) you can separate HTML from PHP just as you may with perl. While Rasmus does claim PHP is a templating language, there are plenty of PHP developers using template engines (look at the popularity of Smarty in the PHP world if you have any doubts). (2) PHP5 introduced E_STRICT, which operates very similarly to perl's 'use strict'. Additionally, you can set error reporting to either be completely off, show all errors and warnings, or a number of grades in between. Basically, you can get PHP to complain about exactly the same sorts of things perl complains about when warnings and strict are used. (3) can also be considered a benefit; there's little need to add external libraries as they're already compiled into the language. And regarding (4), PHP has not been limited to the web for quite some time; the CLI SAPI has been compiled into PHP by default since version 4.3.0, and was available in the entire 4.x series. While the CLI doesn't have the popularity of the web SAPIs, it is available, and many PHP programmers utilize it (myself included).

    Your reasons for choosing perl have everything to do with yourself and your personal preferences, and little to do with the language. One can be either a careful or slipshod programmer in perl -- as in any other language. CPAN and the Monastery are probably the best reasons for choosing perl over another language -- but PHP has PEAR, user comments to the online manual, and a variety of lively mailing lists, making even those considerations somewhat moot. Basically, you should choose the language that suits the problem at hand, and, if possible, that others to whom you have direct access use (i.e., if your co-workers use a language and are proficient in it, you should probably try to utilize that language as you'll have mentors and people who can help debug and maintain your code).

Re^2: Perl/CGI Vs PHP Vs ASP
by astroboy (Chaplain) on May 21, 2005 at 19:40 UTC
    I have at least a few problems with ASP: ... 3) I'd have to learn VB (too much like the old days).
    To be fair, ASP doesn't restrict you to a language. If you've already got ActiveStates Perl on Windows, then you have PerlScript. You also get Perl for ISAPI, a technology for speeding web sites under IIS.

      Thanks for the clarification. That's reassuring. I've not spent much time with ASP, but if I get into a situation I look into the other scripting methods.


      —Brad
      "The important work of moving the world forward does not wait to be done by perfect men." George Eliot