develooper Front page | perl.p5ee | Postings from December 2004

Re: PHP is the scourge

From:
Pinda Ndaki
Date:
December 6, 2004 15:42
Subject:
Re: PHP is the scourge
Message ID:
41B4EE50.50908@ndaki.com
with all due respect to all lets please leave the flame wars for slashdot. 

That being said,  I think Perl is an incredibly flexible tool, capable 
of doing almost anything.  You're right, CPAN is an incredible resource 
etc, etc etc.  However, PHP also has a tremendous amount of utility and 
is a powerful tool in its own right.  PHP5 has taken PHP to a new level. 

If you're open, here's my 2 cents on why you might consider PHP
The Object oriented features have been really dramatically improved if 
you're in to that sort of thing  Access modifiers, interfaces and 
inheritance work really well.. 

The database access pieces have always been a wart, but Pear::DB was and 
is a big step in the right direction, it's no DBI, but its serviceable.  
>From my experience, switching databases from one to another in PHP when 
using Pear::DB isn't any more difficult than if I were using DBI or JDBC 
because the hard part in switching Databases is always in the "native" 
database code.  The selects and inserts tend to transfer pretty readily, 
it's the procedures,triggeres and functions that can kill you.

PHP is also now a JSR and will most likely be included in a future 
version of the Java J2EE specification as an official scripting 
environment in J2EE.  PHP is also an important tool because it's very 
easy to get it up and running and doing your job, and it behaves very 
similarly on Windows and *nix.

PHP is a "just works" tool for Web applications.  In that narrow 
context, I honestly believe it's the best thing going bar none.  It's 
got all the bases covered:  Easy Session handling.  Strong WYSIWYG 
tools. Strong templating engine (a tool called Smarty.  It's not TT2, 
but it's a strong tool nonetheless). Abundant  hosting  support. 
Extremely high productivity for both small and large applications. Low 
resource thirst (You don't need big iron to get it to perform). 
Extremely easy to setup.  Extremely easy to learn.  Easy to extend.

Other languages don't have to suck in order for Perl to appear good.  
Every language has warts, that's part of their charm and why we love the 
ones we do and hate the ones we don't. I've found that I tend to stick 
to languages and tools whose warts are in places that piss me off the 
least.  It's all context sensitive.  Can Perl do everything that PHP can 
?  Yes.  Is Perl a better tool than PHP ? Depends on the context.  
Depending on our need, every language has issues.

Just a thought.

Pinda



Christopher Hicks wrote:

> On Sat, 4 Dec 2004, Marty Trujillo wrote:
>
>> I love perl,  I love perl... but does perl have any advantages over PHP?
>
>
> Many.  (1) It makes the easy things easy and the hard things possible. 
> (2) CPAN.  (3) Its a very forgiving language unless you want it to be 
> ruthless about what it accepts.  (4) Its not limited to the web.  Perl 
> was "the systems admin" language long before it became "the web 
> language". Its obviously neither exclusively, but rather a language 
> that makes a good fit for lots of "glue"-type situations.  Perl is the 
> duct tape of the Internet.  PHP is the cheap dime store celophane tape 
> that dries up after a few weeks.
>
>> Is it time for me to learn PHP?
>
>
> Not unless you're trying to broaden your work opportunities.
>
>> Any thoughts?
>
>
> PHP is an absolutely abomination that was ill-conceived and iller 
> executed.  It started off as a watered down Perl and its grown to be a 
> vast library of poorly thought-out functions.  So its become the 
> defacto language for people that are scared by Perl to try to write 
> webapps in. The results have been horrific as another poster 
> indicated.  Numerous absolutely awful PHP open source projects exist.  
> The few "good" PHP projects are still a real chore to deal with 
> because of lack of flexibility in database backends without rewriting 
> every database interaction and the tendancy to have the PHP write too 
> much of the HTML so that your designers have to learn PHP to fix look 
> and feel issues.
>
> If you're looking at learning something consider Apache::ASP.  It 
> brings the good parts of the ASP/PHP web development paradigm into a 
> Perl context.  We've been doing heavy development with it and I'm 
> quite pleased with the increase in productivity over more traditional 
> CGI/mod_perl development that we've been doing for ages.
>



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About