My Perfect PHP Framework

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,

myframework

Now, what is my perfect PHP framework? here you go ..

  1. MVC wise

    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.

  2. 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.
  3. Designer friendly
    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.
  4. 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.
  5. PHP4 Enable
    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,

PHP
You shoot yourself in the foot with a gun made with pieces from 300 other guns.

Let’s keep it that way, shall we.

🙂

Join the Conversation

8 Comments

  1. PHP is already a perfect Framework for simple projects even as a templating language 😛
    The bad thing is that there is not a single convention in function naming, and parameter passing. I feel that frameworks are
    unnecessary unless you are building large projects or working together with other people.

    My personal choice for large sites and intranet apps is the Akelos Framework, which
    matches all your observations but number one. Actually this could be done as in Rails by
    separating the three components in separated pieces M ActiveRecord, V ActionView and C ActionController which the creators
    might do in a future if someone asks them.

    Zend Framework seems to be a good choice for a large projects, but I think its far
    more complicated than Rails/Akelos plus Akelos plays nicely on l10n and i18n were all the other frameworks trend to fail.

    I had a look to Cake after playing with Rails and I found many differences and naming inconsistencies.

    For small stuff I do as you PEAR, raw PHP if I’m coding by myself and Sintags when collaborating with Dreamweaver designers (luckily not too often).

    When do you decide to use or not to use a Framework?
    Has anyone measured the effort that requires learning a whole new set of conventions, and ways of doing things? Is it really
    worth?
    Should we kill all PHP frameworks and move to Ruby on Rails and stop discussing about which
    one is the best?
    Should we push a little bit Akelos and hope it becomes the new PHP on Rails (they still on development preview) or we should
    all move to Zend and empower their
    solution as the standard?

    I really feel that the amount of available frameworks for PHP is
    causing a big damage to the language itself. Motivating other (like me) to use Ruby whenever its possible.

  2. Well, we looked at ROR and python`s Turbogear, but then we did stumble over CakePHP (http://cakephp.org).

    CakePHP was a kind of ROR clone when it started, but now it is much more than that.

    We did choose it over ROR simply because it is for us, especially since 1.0, better and faster to get real results, real applications (and not just a little toy demo app), and very much alive and progressing. Examining its code shows that it is a very clean OO code.

    Codeigniter and similar do not reach the level of it.

    We use CakePHP now for all projects, and ported some multithousand line web applications to it, and are very happy with the result.

    Another plus is the friendly and fast support in the #cakephp IRC channel and in the google group.

    So for us, not just in theory and after scanning a introduction text on the website, "My Perfect PHP Framework" is CakePHP !

  3. My favorite is QCodo and to supplement it I use Qooxdoo and Dojo to do AJAX stuff faster and easier…. try them you will like them to!!

  4. Pingback: What Is Php
Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.