[Israel.pm] Perl versus PHP for a Scalable Web Project
shlomif at iglu.org.il
Sun Mar 18 12:57:34 PDT 2007
On Sunday 18 March 2007, Elizabeth Sterling wrote:
> Hi guys,
> OK, we were just talking about "Why companies don't use Perl for
> big projects" so, here's your chance to help me get Perl used for a
> biggie. No, I'm not asking you guys to do all my work for me, but I'd
> like to make sure that I'm not missing anything...
> Here's the situation:
> A large social networking-type Website needs a new system from the
> ground up. There is no question regarding a few of the pieces. They
> will definitely use Linux. They will definitely use MySql. They will
> definitely have an AJAX-y front end. There is a question, however
> regarding the language in between. PHP? Or Perl?
> The arguments for PHP are that it's easy to get someone who can
> write it. Even if you hire someone with ASP experience, you can get
> them up to speed in PHP pretty quickly. That's rarely necessary,
> however, since there are plenty of PHP monkeys out there. (She says
> between scratching under her arms and letting out an accidental
> "ook!") There are also a lot of existing opensource tools that can be
> used to build certain pieces of the networking tools, calendar
> systems, etc.
> The biggest argument I can make for Perl right at the moment is
> that its i18n/l10n capabilities are much stronger, and this site needs
> to be up in multiple languages and both directions from the minute it
> launches this new version. There's no time to mess about with PHP's
> hand-stand, fingers in the ear on the opposite side of your head
> approach to multiple character set usage. But that's not enough of an
> Scalability is certainly an issue, but I've worked on sites that
> run in PHP and get millions of unique visitors per day, so the
> question is maybe not "is it scalable?" but "how much will it cost to
> scale?" I *think* that Perl is cheaper on resources in the long run,
> but I don't have any specific data on that. Do any of you?
> Your thoughts, insight, and best arguments for Perl would be
> warmly welcomed!!
Some things off the top of my head besides what Gaal and you said:
1. My imperssion from PHP back when I was employed to write PHP code was:
2. It is much easier to write insecure (or otherwise buggy) PHP code than it
is using Perl (at least with strict, warnings, possibly taint on and some
good rule of thumbs). Whenever I programmed in PHP, I felt that I have to be
much more self-conscious about what I am doing. That feeling may have become
better with experience, though.
3. Perl has CPAN which is a good plus. PHP has PEAR and other extensions
available online, but it still doesn't match the scope and quality of CPAN.
4. In your case they will obviously have their own dedicated hosting, PHP's
advantage of being easier to deploy does not hold.
4. Perl is a richer and more expressive language than PHP which allows for
smaller and more modular code than PHP, with better abstractions. This is
assuming your programmers know what they're doing.
5. Relying on PHP "code monkeys" to do your job is a recipe for disaster. If
you want your codebase to be solid, maintainable, etc. you need good or very
good coders. In PHP or in Perl.
If someone is a good PHP programmer, then he can easily get up to speed with
Perl. If he or she is a bad PHP programmer, you're screwed anyway.
> - Elizabeth
Shlomi Fish shlomif at iglu.org.il
Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.
More information about the Perl