Fw: PERL or PHP?
| From: | Matt Friedman | Date: | Wed, 13 Dec 2000 18:13:54 +0000 |
| Subject: | Fw: PERL or PHP? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30122@lists.php.net to get a copy of this message | ||
In response to: "Rob McMillin" <>
Well, I guess people tend to like what they know best.
It's clear that Rob knows considerably less about PHP than perl.
He's right however, that php is less obtuse and provides simpler interfaces
to many web scripting tools. If you want to learn the obfuscated perl code
to do the same stuff, then that's fine I guess. Perl is a nearly all purpose
language. PHP was designed from the ground up to be web scripting language.
What it lacks in the way of perl's refinements, it makes up for in it's ease
of use and in how easy it is to learn. PHP makes scripting easier for the
newbie (I guess that threatens some people who think that coding should be
mysterious and hard.) but has plenty of room for sophisticated web
applications. Plus, you can call and receive input from perl scripts from
your php scripts if you really wanted to.
And it's true that php is young, but there is a perl like repository in the
works for PHP called Pear, not to mention the reams of classes and free code
you can find to "get the job" done.
Additionally,
-php uses "is_array" to tell find out if a data structure is an array or
scalar. (Who'd of thunk it? "is_array" tells you if data is an array.
wacky.)
-there are several rock solid classes which allow for database abstraction.
-after reading "Web Application Development with PHP4" which contains the
full Zend documentation on extending the core of php, I would say that php's
extensibility is quite well documented. Many sites add their own C modules
to php. In fact, anyone who knows C can extend php.
I'm sure that there are significant advantages to perl. Perl has been around
longer and has had the benefit of many years of open source development and
refining. But there are also many advantages to PHP too. Depending on the
project, PHP if often the way to go.
I don't see any reason for calling the developers "hacks". All they've done
is written an accessible scripting language that more and more people are
adopting because of it's fast performance and ease of use. Rob even admits
to using it on his site. Why so hostile?
Matt Friedman
----- Original Message -----
From: "Rob McMillin" <>
To: "Mike Podlesny" <>
Cc: "mySQL Mailing List" <mysql@lists.mysql.com>
Sent: Wednesday, December 13, 2000 9:13 AM
Subject: Re: PERL or PHP?
> Mike Podlesny wrote:
>
> > Which is better to use to access a mySQL database Perl or PHP?
>
> Perl has some performance drawbacks which can be fixed with mod_perl. It
> does take longer to learn well than PHP. Those are really the only
> reasons not to use Perl.
>
> Some good reasons TO use Perl vs PHP:
>
> - Perl DBI is more secure than PHP. By this I mean it actually supports
> placeholders in query operations.
> - Perl has CPAN, with hundreds of canned modules to help you do your
> job. PHP has... what?
> - Perl has real object-oriented features. PHP doesn't seem to use what
> it has.
> - Perl supports real-world data structures. PHP doesn't.
> - PHP can't tell the difference between a scalar and an array of length
> 1.
> - PHP's database interfaces are all hard-coded.
> - PHP's extensibility is woefully documented, making it very hard for
> third parties (e.g., me) to go in and add new features.
> - Finally, PHP seems to have been designed by rabidly anti-Perl hackers
> who arbitrarily decided to drop very useful Perl refinements for no
> discernable reason. For instance, there is no equivalent of the "eq"
> string comparison operator; instead, you have to use the more opaque
> strcmp() from C.
>
> Perl will take you longer to learn. But what you do learn will be the
> Right Thing, as opposed to a bunch of lame hacks you will learn using
> PHP. In PHP you will find yourself coding your way out of numerous
> sandtraps that just don't exist in Perl. We use PHP on our site, and it
> works okay for that, but I wouldn't dream of starting an equivalent
> sized project in it, knowing what I know now.
>
> --
> http://www.pricegrabber.com | Dog is my co-pilot.
>
>
>
>
> --
> ---------------------------------------------------------------------
> Please check
> "http://www.mysql.com/documentation/manual.php" before
> posting. To request this thread, e-mail mysql-thread58925@lists.mysql.com
>
> To unsubscribe, send a message to:
> <mysql-unsubscribe-matt=daart.ca@lists.mysql.com>
>
> If you have a broken mail client that cannot send a message to
> the above address (Microsoft Outlook), you can use:
> http://lists.mysql.com/php/unsubscribe.php
>
>
>