Feb 22

Tim Bray on PHP

On PHP: There have been a lot of blogs jumping around on PHP in the last few days, and I’ve finally tracked it back to its source. Tim Bray — one of the “pillars of the Web,” if I can be so bold — posted about PHP a week ago. He mentioned about how much press PHP has been getting, then dropped this:

So here’s my problem, based on my limited experience with PHP (deploying a couple of free apps to do this and that, and debugging a site for a non-technical friend here and there): all the PHP code I’ve seen in that experience has been messy, unmaintainable crap. Spaghetti SQL wrapped in spaghetti PHP wrapped in spaghetti HTML, replicated in slightly-varying form in dozens of places.

And this is apparently where it all started. What’s interesting are the comments flying at Tim. He doesn’t have comments on his blog, so he’s manually adding them to the post because he’s been impressed with the discussion.

Adam Kalsey, I think, hits the nail on the head most closely in the very first comment.

[…] since PHP is easy to learn, is ubiquitous, and there’s lots of PHP examples on the web, it’s easy for a non-pro to pick up PHP and start monkeying with it. They learn bad habits and then publish their code and teach others bad habits. Some of the most popular open source PHP applications ever are really poorly coded. Gallery and Wordpress come to mind.

And that’s the truth of it: PHP is so easy, that the barrier to entry doesn’t weed out people who write crappy code. Classic ASP is the same way — there’s a lot of heniously bad ASP floating around out there. And ColdFusion — I’ve seen some stuff written in ColdFusion that would curl your hair.

But at the same time, there’s good ASP — I’ve personally written some great ASP. I have a project now that I have to write in classic ASP, and I think it’s as good as you could possibly write something in ASP without resorting to COM. FogBugz is written in ASP, and I’m willing to bet it’s good ASP because Spolsky is a friggin’ ninja.

And there’s some great ColdFusion too, including full-blown frameworks like Fusebox and Mach II.

And, of course, the same goes for PHP.

I don’t want to beat a dead horse, but if you go back to my post on Camaros and PHP, you’ll see I was saying something along the same lines. More complicated languages like J2EE and ASP.Net have a higher barrier to entry — it just takes longer to figure them out — so the people who are going to write bad stuff tend to drop out and turn to something easier…like PHP.

PHP is therefore a victim of its own simplicity, flexibility, and ubiquity. I guess I can think of worse things than that.


Comments

by Brian,   February 22, 2006 7:39 AM  

Nice post Deane. As I did on the Camaro post, I will continue to politely disagree about one small point, at least when it comes to .NET. The financial barrier to entry is definitely higher with .NET, only because you usually have to shell out for closed-source toolsets to work with it productively. However, the technical barrier can actually be lower for simple stuff (i.e., the type of stuff a beginner or simpleton would likely write). Open a new solution, hit F5 -- blammo, you have a working web app.

I would almost argue that the barrier to entry is probably about the same regardless of langauge -- you have to learn a syntax, learn a toolset, learn a DB. The difference is that with PHP, a crappy programmer with the proper aptitude can potentially become a halfway decent programmer in a relatively short period. With .NET, the bad programmers don't drop out so much as they just spend a LOT more time writing crappy code until they hopefully one day figure it all out. I've been working in large .NET shops for several years now -- believe me, it does not take a ninja to get a .NET job these days, especially given the increasing demand (at least in Austin).


by Deane,   February 22, 2006 8:01 AM  

So, if you're a HTML-only developer, what environment has the lowest barrier to entry? ColdFusion?


by Adam Kalsey,   February 22, 2006 9:01 AM  

The link on my name goes to Gadgetopia. Did I miss a press release or something? When did I start writing for you guys and why didn't someone let me know? :)


by Deane,   February 22, 2006 10:20 AM  

The link on my name goes to Gadgetopia.

One can dream, man, one can dream.


by Tal Ater,   February 22, 2006 12:31 PM  

As someone going through that painful transformation from spaghetti code to delicious ninja goodness, I have seen both sides of this argument... And I completely agree.

If anyone hasn't read the original Camaro of Programming Languages, I encourage you to do so, and spread it around... It should be required reading to both holier-then-though trendy language evangelists and "spagethii coders" looking to take it up a notch.

I just submitted the original PHP: The Camaro of Programming Languages post to Digg, show your support.


Spolsky is a friggin’ ninja

Ha! that line alone was worth reading the entire post.



Add Comment


Want to advertise on this site? Contact FM.
Web Hosting Web hosting, dedicated servers and Web design services
Laser Toner Cartridges UK laser toner, toner cartridges, hp toner, lexmark toner, samsung toner, canon, toner, epson toner, oki toner, kyocera toner, xerox toner, remanufactured toner, compatible toner
Direct TV Deals Free 4 room direct tv deals. no equipment to buy. free fast professional direct tv installation. this is the best direct tv deal available anywhere.
SEO Article Learn from the experts with our SEO article.
rope light Shopping with birddog distributing, inc., gives you access to the lowest prices, the best customer service and the quickest delivery times possible.
Laptop AC Adapter We offer genuine factory direct replacement AC adapters.
Direct TV Best satellite TV deals.
Direct TV Deals Direct TV programming deals are varied and include packages containing from 50 channels up to over 250 channels.
8mm film to DVD Retain family memories with the only frame by frame digital restoration service in the United States for your 8mm film to DVD today
Rubber Stamp Shop for custom self-inking stamps, hand stamps, address stamps, label stamps, check endorsement stamps, check deposit stamps, date stamps, pre inks, pocket stamps, ink and much more!