Speed, quality, price. Pick two. You have no doubt heard that mantra
before, but PHP and Perl
offer all three.
The question is, how do you choose between the two programming languages,
which are both insanely popular for Web development?
Perl has been around much longer than PHP, and is by all accounts more
flexible. In fact, PHP actually started out as a Perl application and was
designed specifically for Web work. Perl is not specifically tailored to
working with Web sites, but it has other advantages.
Perls of Wisdom
For example, Perl is undeniably ahead of PHP in terms of longevity and flexibility,
and it has an arsenal of pre-developed modules that PHP cannot match. The
Comprehensive Perl Archive Network
(CPAN) contains 3,876 modules at present. Although PHP now has a similar
project, the PHP Extension and Application
Repository (PEAR), it does not come close to CPAN's massive archive
of modules and documentation.
Longtime Perl hacker Randal Schwartz, who admits he is biased in favor of
Perl, agrees that PHP is "an easy way for someone who wants to learn
'just a little bit of programming'" to use server-side scripting on
a Web site. However, he sees Perl as the best bet for larger sites.
"Once you get into the heavy lifting, Perl starts being your best
friend," he told NewsFactor.
Schwartz also noted that Perl still has a significant lead on PHP.
"PHP is where Perl was before Perl added all the features needed for large
application development (back in the Perl4 days)," he said. "And while you
can develop a large site in both PHP and Perl4, you end up requiring a huge
amount of discipline to keep it bug-reduced and maintainable. Perl5 has left
that mode significantly behind, with proper modules and objects and
advanced programming features."
Strengths of PHP
On the other hand, Zeev Suraski, Zend Technologies
co-founder and chief technology officer, told NewsFactor that PHP's simplicity
gives it an advantage over Perl. "Perl starts easy but tends to get complicated
very quickly... PHP starts easy and remains easy," he said. "That helped PHP
grow almost exponentially and basically take over Perl's 'Web King'
status from five years ago."
PHP also is perceived as a simpler language, which makes it attractive,
according to Suraski. "Simplicity is not only at the language level, but
also has to do with installation and perception. Most people were, and
some still are, under the impression that using Perl for the Web is done
through cgi-bin scripts. In the past, mod_perl
had very little exposure." (continued...)
|