PHP Scalability Critique

Jul 17

PHP Scalability Critique

Experiences of Using PHP in Large Websites: This is a well-written, well-researched, but ultimately damning indictment of PHP’s use in “large Web sites.”

The conclusion arrived at is that, in some circumstances at least, PHP’s tendency to create more problems than it solves makes it an inappropriate choice. However, we also recognise that there are some situations in which PHP is to be used.

I agree with a lot of what’s written here, but they’re not roadblocks that have ever really hindered me. If you abstract your code well, and you’re not working on a site with a lot of other people (I usually work alone), most of these problems are non-events.

Yes, function naming is goofy. Yes, there are no namespaces. Yes, the whole magic quotes concept is a pain. But I still write better stuff faster with PHP than with any other langauge.

They talk about templating and code separation early on, and the perfectly describe what has become my de facto templating method:

Divide every PHP page up into two parts: the former performs database queries and does whatever else is needed to calculate the content for the page, before storing the calculated content into a series of variables which — and this is crucial — contain no markup. Then the latter part of the page can simply embed variable values into HTML markup, using loops where appropriate to traverse potentially-complex data structures containing the actual content.

I actually have two files — the actual code, then a “.tpl” file that’s included at the bottom of the code. That way, two vastly different sets of code can use the same template. I know this isn’t perfect, and Joe never hesitates to tell me that I should be using Smarty instead, but it works well for me without the (1) need to learn another language syntax, and (2) the additional overhead required for template processing.

Thank to Jonathon Hollin for this link.


Comments

by Monk,   March 13, 2006 9:38 PM  

If you are not working on a site with a lot of other people (I usually work alone), most of these problems are non-events.

I think you've got it in a nutshell and let's add the other saving grace of PHP: requires little or no skill to get started. Those who are skilled Java programmers who work on projects of 2 to 200 people (read: serious projects with significant business impact) shouild use Java. Unskilled individuals slapping together a few pages should use PHP.



Add Comment


Want to advertise on this site? Contact FM.
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!