Tommy’s Blog

Photography, technology, and a little bit more from Tommy Williams

Why does PHP have to be professional-grade?

20th February 2006

Tim Bray complains that all the PHP code he has seen has been “messy, unmaintainable crap.” The responses he has posted mostly confirm his opinion, saying things like, “it really needs to clean its act up to appeal to people coming from other programming languages, instead of just people coming from dreamweaver.” Or “it hasn’t been proven that users *can’t* write clean, comprehensible, maintainable PHP - but it also hasn’t been proven that anyone can.”

One response, perhaps unintentionally, points out the absolute beauty of PHP: “people with little or no education in the realm of programming are programming.” Hallelujah! Too bad that he introduces that beautiful statement with this lead-in: “Herein lies the main problem.”

Fine. So PHP isn’t “professional grade.” But it can be used to do some pretty amazing things. The software that powers this blog, and thousands of others, is written in PHP. I wasn’t surprised to see it called out as an example of poor code.

Does it matter? No. The easy entry to programming that PHP offers is letting people with ideas — people with passion for things that are not software — to produce some magnificent work.

So it’s hard to refactor. So it doesn’t scale. So it’s impossible for someone else to come along and maintain it. That’s OK. We have dozens of languages and programming environments that scale up to big teams and big demands and that promote good software practices.

Why not have a language that doesn’t value the enterprise first? Isn’t there room for the hobbyist?

This argument against PHP feels a lot like the one the professional journalists have been throwing at amateur bloggers. There’s certainly room for both journalists and bloggers; if anything, we’re hearing that it’s the professionals that are at risk in the imaginary journalists vs. bloggers showdown.

I’m not trying to discount the value of well-written software: over the past decades, we’ve learned a lot about the value of disciplined, well-designed code. Just don’t forget the value of the folks with the ideas and the passion to implement them. We need software that supports them. And if they make a mess along the way? It’s fine with me.

Update (2006-Feb-27): Shelley Powers, writing about all the languages she has learned over the years, also points out the value of PHP’s ease-of-entry and its ubiquity. It’s an entertaining article in its own right, even if you don’t care about PHP.

Tags: , , ,
del.icio.us tags: , , ,

6 Responses to “Why does PHP have to be professional-grade?”

  1. Curious George Says:

    So it’s hard to refactor. So it doesn’t scale. So it’s impossible for someone else to come along and maintain it. That’s OK.

    I can buy that argument. Now, will you please inform Zend of this so they will stop telling us how enterprise ready PHP is? ;)

  2. Philipp von Weitershausen Says:

    Why not have a language that doesn’t value the enterprise first? Isn’t there room for the hobbyist?

    Sure, obviously there is room, otherwise PHP wouldn’t be so successful. However, the problem really isn’t hobbyist or scripter niche. The problem is how PHP grew out of that niche. The people who were once scripters grew their scripts to be full blown apps. Now maintainability, decent abstraction and things like security do play a role.

    It is no coincidence that people who had to eventually face “enterprise” (God I hate that word) challenges mostly went away from PHP. I was one of them, now I’m developing with and on Zope. There we have the opposite problem of PHP. We don’t scale down enough, whereas PHP doesn’t scale up well. Wouldn’t it be nice if there was something that would scale to all sizes and complexities of web apps?

    I think it’s possible. I don’t think it’s gonna a PHP thing, though :).

  3. Mike Papageorge Says:

    Hmm.. You make a good point about my post. I shouldn’t have called that a problem, because it isn’t a problem.

    The low entry point and excellent online manual make PHP available to everyone, and make it the success that it is today.

  4. Warren Fred Says:

    Fine for the hobbyist. Just make sure nobody tries to code up anything involving MONEY or SAFETY using PHP.

    Too late. And we can’t stop them. I don’t know how many web stores are built on top of PHP spaghetti but when the big worm hits we may find out…

  5. appel Says:

    I know this is a late reply, but it’s worthwhile to go and see how many security vulnerabilities Wordpress had. Gentoo Linux even removed it from their portage tree a few weeks ago as it’s just too insecure.

    Cheers

    >Fine. So PHP isn’t “professional grade.” But it can be used to do some pretty amazing things. The software >that powers this blog, and thousands of others, is written in PHP. I wasn’t surprised to see it called out >as an example of poor code.

  6. So much loving and hating with PHP « Rudimentary Art of Programming & Development Says:

    […] is easy. Darn easy language. Many, like this one, said that PHP allows non-programmer doing programming. That argument, I think, is the strongest […]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>