Apr 05 2006
The no-framework PHP MVC framework
Ramsus Lerdorf, creator of the PHP language and currently Infrastructure Architect at Yahoo!, wrote an article in late february advocating taking a step back and analyzing whether using a pre-built framework (or OOP) in a web application actually makes things easier. Frameworks such as Prototype (JavaScript) have been gaining popularity for developers seeking to create a “AJAX/Web 2.0/Rich Client” application, in his opinion placing too much emphasis on the controller in the Model-view-controller design pattern.
The article has generated a storm amount of criticism, but the technique is being used at Yahoo! and there are a fair amount of designers that say they’ve come to similar conclusions. Besides raising architectural concerns there are some optimization tips throughout the article, which outlines building a simple rich web application based around SQLite, JSON, and PHP/XHTML/JavaScript.
In general Ramsus endorses a minimalist / simplistic approach to coding, as exemplified in Rasmus Lerdorf’s Simple Guidelines for PHP Programming:
- Try to limit yourself to 5 or less includes per request
- Don’t go overboard on OOP. Use where appropriate.
- Same goes for Layers. Abstraction, Indirection, abstract classes.
- Everything has a cost
- Use an opcode cache
- Watch your regular expressions!
- Cache! Cache! Cache!
- If you have plenty of CPU but limited bandwidth, turn on output compression
