Acknowledging "An argument for PHP"


Adam Scheinberg makes an argument for PHP, which is fine in itself, but misses a key point about those of us who are horrified by PHP as a language.

I argue than everyone posting about how PHP is a bad language as a whole is an idiot. Every single one. Each is a foolish, arrogant, nerd sheep who can't think for themselves.

Scheinberg acknowledges some of the problems with PHP, but then says that PHP is good because you can run it all over the place, and many big sites serve lots of traffic with it, and boy isn't mod_perl a pain in the ass to install? And sometimes PHP is just a great tool for the job at hand:

[t]hose who would forsake "the right tool for the job at hand" shouldn't be trusted even to water your plants, because they are obviously nitwits. If you can't concede that PHP can be the right tool some of the time for some situations, you shouldn't be trusted to code or make adult decisions.

Can't disagree with that at all, Adam. It's all a matter of using the right tool for the job. Sometimes that right tool for the job just happens to be a crappy language.

So, as a foolish, arrogant, idiot, nerd sheep, we can agree that:

  • Sometimes people's decision process brings them to the conclusion that PHP is the best tool for the job, and I don't doubt that they're right.
  • I don't mind using PHP packages because I don't have to write in it.

Nonetheless, PHP is still an awful language, and in my decision making process, the pain & anguish I go through to use it means it rarely winds up as the right tool for the job.


I don't accept the "right tool for the job" argument unless the languages are significantly different enough to make the argument.

I find that perl, ruby, python, php, pike, and various others (maybe even java) all fill pretty much the the same role. The differences between them are largely a matter of individual and organizational taste. Which syntax, whether the module system bothers you, etc.

Significantly different languages include C, which is the almighty backend that seems to have somewhat replaced assmebler as the low level tool of choice (even for many embedded applications). (You'd be silly to embed perl on small devices.) They include Haskell, which is more like writing math than code. They include prolog, which is good for what again? You see what I mean. :-? Yes.

Anyway, looking at just the two: perl vs php. The differences are all cosmetic. They have very similar syntax. They can both be used for gtk, cli, cgi, db. Neither can be compiled down to machine specific executables...

Some people pick perl and some pick php. It's a matter of taste, not which is the "right tool." that is a very silly argument, like Vim vs Emacs. For the record, I'd never choose PHP for anything; because I already know a p-language. I'd choose pike next if I got bored with perl.

Saying "Use the right tool for the job" is an attempt to look smart while saying nothing interesting, useful, or insightful -- especially when the discussion is about how to identify the right tool for the job.

You know, his article about PHP is much like articles I've seen here about Perl--an argument in favor of Perl when people are attacking it. I could probably re-write your response and switch a few words around, replace "PHP" with "Perl" and we'd have some typical blog responses to Perl advocacy as well.

I agree, though, that "the right tool for the job at hand" isn't really a factor between PHP and Perl, at all.


You know, I believe that posts like this one (and a few others you've posted) just give programmers using other languages (esp. PHP) reason to say, “Perl hackers are assholes.” There is no substantive argument here. It's just “PHP sucks,” and that makes it easy to simply dismiss Perl.

What if I was a Ruby hacker, posting on, and wrote that "Perl is a hackish, ugly language that learned its syntax from modem init strings. I'd never use it because of the pain and anguish it would cause me." Would that do anything to promote Ruby? Is it a valid criticism of Perl? Or am I just saying that I hate it for no good reason? Where is the substance in that?

I think that these “X language sucks because it sucks” posts are detrimental to the community. Please stop posting them, they just make the Perl community sound desperate and tired.

Substantive critiques, OTOH, can be highly useful, especially if there are accompanied by other posts that are equally open about Perl's weaknesses. What are the problems with PHP? Can you demonstrate with examples? Why do the same problems not exist for Perl? Now that would be worthwhile, IMHO.


The key is that the original posting says "I know that PHP has problems, but hey, sometimes it's the best tool for the job." To hand-wave using a bad language because it happens to be convenient ignores the technical debt used by a bad language. It's like the PHP apologists are saying "Yeah, it sucks, but it works OK." That's fine, but that doesn't take away from all the problems endemic in it.


That may be so, but that's not my point. My point is that posts like this one do a disservice to the Perl community, IMHO, because there is no justification whatsoever for the assertion that PHP is a “bad language.” After all, Perl, too, has its problems, and it is still often the best tool for the job. That has nothing to do with a value judgement of Perl itself, and one like “it sucks” just sounds like an ad hominem attack on the language.


I didn't give the justification for saying PHP is a bad language, because the original post made them for me.

Does it make me too an arrogant nerd sheep that I’ve written about PHP being good but bad? I guess so. Oh well.

Much as I love Perl, for the past several years I have found it not the right tool for the job because either

  • I wanted to distribute software to other users
  • I wanted to run software on a cheap web host

The Strawberry distribution is a potential solution to the first problem. But to be truly competitive with Adobe Flex / AIR -- which I am using for a current project -- it would have to be able to create a self-installing executable that could run on Windows, Mac and Linux.

I still think in Perl, but as an only occasional programmer, I seldom find it the best tool for the job. The Perl community failed to successfully colonize the new ecosystems of programmers who don't have root access. Simply asserting that PHP is linguistically inferior won't convince anyone who has had to argue with a web hosting company about the load MovableType was placing on their servers.

Ugh. I wish you wouldn't post these petty language bashing entries. Let's try and stay above that shall we. Language bashing != advocacy Andy.

Why is it whenever someone from the Perl community says something negative about PHP it's vilified as "bashing", but PHP folks can sling mud and FUD about Perl with virtual impunity? Andy isn't a reporter, he's a commentator and can give his opinion. Frankly, as someone who uses both languages (one by choice), I agree.

Every time someone says "foobar sucks" doesn't mean they have to give a discourse on their opinion.

i'm curious what language folks think is really good.

i'm happy enough with PHP. it's definitely better than PERL for most things I do. both are far superior to Java and C/C++/Fortran. and Ruby and Python are even uglier than PERL.

so, to me, it's PHP. :)

seriously, though - what is the best language? do any of them even stand out above the others in any significant way on more than a single measure?

i say it's about time we create our first super-language from scratch. why not? we'll just take one of the existing languages and modify it to our heart's content - all the stuff that's broken with it - grab best of breed from the others - and say no backward compatibility for anything - it's a brand new language, and doesn't have to support anything but it's own first version.


Leave a comment

Job hunting for programmers

Land the Tech Job You Love, Andy Lester's guide to job hunting for programmers and other technical professionals, is available in PDF, ePub and .mobi formats, all DRM-free, as well as good old-fashioned paper.