PHP more popular than Java? Say it ain’t so!

This morning I read an article on ZDNet Australia titled “Andreessen: PHP succeeding where Java isn’t”, which is about a speech given by Internet browser pioneer, Marc Andreessen, wherein he predicts that PHP will inevitably become more popular than Java because of its simplicity. PHP might appear simple at first glance, but if you actually spend some time working with it, you begin to feel as though the language was built by a thousand monkeys at a thousand computers – the dumb kind employed by C. Montgomery Burns. The final result is such a dog’s breakfast (or should that be monkey’s breakfast?) that continued use only leads to the most unmanageable mess conceivable. Given the choice between a poke in the eye with a sharp stick, and using PHP, I’d take the poke in the eye.

As a case in point, consider the function naming convention, or total lack thereof, in PHP. The function to escape special characters in HTML (such as © to ©) is called htmlentities whereas the opposite is html_entity_decode. This is just the tip of the iceberg; PHP is riddled with these inconsistencies. Why anybody would willingly touch PHP is beyond me! Well, maybe it’s not totally beyond me, because I did try it once, but having bathed several hundred times since I last used it, I feel clean again.

Perhaps Mr. Andreessen will be proved correct, but just because PHP may become more popular than Java, or any other language, it doesn’t indicate quality. Just consider the so-called documentation for the above PHP functions and tell me that PHP is a quality product. The documentation alone probably makes up a good third of the reasons why PHP is a dog’s breakfast. Trying to make sense of disjointed ramblings is almost enough to make one pine for MSDN, even though I don’t much like the look of ASP.NET. Hec, I’d even consider using Ruby on Rails over PHP, even though it suffers from having a stupid name.

I’ll stick with Java, thanks, and if you want to make Java easier, there’s always Jython (even though I haven’t used it, I’ve heard very nice things about it).

P.S., I am aware of the irony that my web site is powered by a product designed using PHP. WordPress is well written and since the poor developers at WordPress have suffered the PHP pain on my behalf, I have no problem with using it :-)

6 thoughts on “PHP more popular than Java? Say it ain’t so!

  1. Too true, I’d have to say PHP is the ugly duckling that only gets to exhibit grace and elegance after much struggle and woe. PHP is expanding due to network effects – unlike mod_perl, mod_php doesn’t go so deep into the guts of apache and therefore more hosting providers offer it. And unlike Perl/Python/Ruby/Java it was always aimed at templating, so there is a single obvious way to create templates in PHP – which is where most web programs start out. And unlike Java, PHP won’t eat all your server memory if there are 20 virtuals on your server with their own little webapps.
    So I think that while there are many, many things wrong with PHP, it is gaining market and mind share for practical reasons. Better use Perl for the webapp and if you want PHP templates, use PHP::Interpreter from the CPAN.

  2. Um, no. My friend, WordPress is a hunk of crap. If you think it’s well-written, you’ve got a lot of learning to do.

  3. I agree

    PHP is great for whipping up a small script for a web SITE, but for web APPLICATIONS i’d go with the poke from a stick too.

  4. Yeah I use basic forms of PHP…..seems to work for me (albeit with some decoding issues on my news section that I’m too lazy to work on)

Leave a Reply

Your email address will not be published. Required fields are marked *