When i first started to write this post, i used “The Perfect PHP Framework” as the title. I thought with that kind of title i would get many people attention as i did before.
But then i decided to change it to “My Perfect PHP Framework”, not because i was affraid of people would criticize me, but because i realized this is the appropriate way of judging PHP framework. There is no such thing as “perfect” framework, for a reason i’ll describe.
So, my perfect PHP framework obviously not pointing out the name, instead the idea or guidelines if you want. But that doesn’t mean i never tried one, i tried many of them as you can see here,
Now, what is my perfect PHP framework? here you go ..
I don’t have any problem with MVC. From programming perspective the idea of isolating UI from domain logic is a great thing. However, if implementing MVC means bringing along like thousands scripts we don’t need, that seems too much for me. So perfect PHP framework must follow YAGNI principle and give user the option to use MVC feature or not.
Loosely coupled components
If you were like me, many web application i made are not too complicated. So i need to be able to chop out some components to use it independently without having to bring along bunch of scripts i don’t need. Most of PHP frameworks today are like this, so that’s great.
As in its definition, framework should be allowing designers and programmers to work together. My experience working with web designers is they don’t want to know about the codes i make. They don’t even want to see the HTML source. They use Dreamweaver or Firework. So good PHP framework must use templating system or at least allowing user to implement templating system, so that designers and programmers can work without interrupting each other.
Few lines to implement
My definition about productive programmer is not in lines of code, but how many web apps you could deliver. That’s why i like PHP. So PHP framework should keep it that way.
Call me old fashion, but it’s true, many web hosting out there still use PHP4. So PHP Framework should be able to run on PHP4, or at least they includes some additional scripts to cover functional that doesn’t exist in PHP4.
Well, which one then? As i said before, i don’t use one framework, instead i use many pieces of framework. I use Zend Framework and my old friend PEAR for many of its neat features, and cakePHP for cool MVC, Xajax for AJAX, plus my own templating system which i felt more appropriate for my needs, especially to deal with my co-worker in web design.
So, my point is that’s what makes PHP interesting. As the jokesaid,
You shoot yourself in the foot with a gun made with pieces from 300 other guns.
Let’s keep it that way, shall we.