For years I’ve been wanting to develop a certain Web 2.0 application I have designed in my mind but I’ve never found the time to do it … until now. It’s not that I have more time these days, but I just can’t stand living without it anymore… Yes, I want to use this application so badly that I can’t stop myself from writing it anymore :)

I’ve decided to blog my experiences developing this application, beginning with how I chose the technology to build it on.

First item: Which PHP framework?

Why a PHP framework and not Rails? Well, I’ve used Rails before and it was my first exposure to the “convention over configuration” concept applied to an MVC framework.

My previous experience in MVC frameworks before Rails was Struts and a proprietary J2EE framework that was used in a project I worked on when I was at Accenture. Using Struts and that framework was XML configuration hell. (Side note: My experience with these frameworks taught me that XML should never be used for anything that might require hand-editing. Especially configuration files!)

After that Rails was (almost) heaven. The thing that Rails (and the newer frameworks) give you is the ability to code websites incredibly fast while at the same time keeping your code well structured. But the downside of Rails (for me) was it uses Ruby.

I found learning Ruby on Rails was learning 2 things at the same time. Ruby AND Rails. I put the hours into learning it properly, first learning Ruby, then Rails and I got pretty competent with it. But then I imagined how hard it would be to find and train employees to use Ruby on Rails. Where I’m at (Thailand) it’s hard enough to find good programmers. I would guess it’s almost impossible to find good Ruby programmers.

PHP on the other hand .. well everyone knows PHP.

Back in 2007 I had to find a framework for developing so I started evaluating PHP frameworks. At that time there were many new PHP frameworks popping up. I started with Symfony .. but I just didn’t “get” it’s beginning example. It all seemed complicated somehow and I just couldn’t get into it. No offense to Symfony though, it was probably just me. The other leading framework at that time was CakePHP. So I started learning it and quickly fell in love with it. Here was a framework that took Ruby on Rails’ ideas, applied it to PHP and made it even better! In the end was built using CakePHP and training employees to use CakePHP was painless.

I still love CakePHP, but for my new Web 2.0 project, I decided to see if there was anything a little more “lightweight”. I discovered the Yii framework. It’s biggest selling point for me was it’s performance .. just take a look at this performance benchmark. While the benchmark is just a Hello World benchmark, it is still significant for me as my new project is almost 100% AJAX which means it will require lots of small requests and the server should respond to each request very quickly for a good user experience. Since Yii only loads parts of itself that’s required in each request as needed (instead of the whole thing as in some other frameworks) it is very fast for small simple requests and I think it should be a great fit for AJAX applications. CakePHP on the other hand is better fitted for large websites where each request is a whole web page as it has lots of cool stuff to help with generating HTML responses.

While Yii’s performance is what first convinced me to try it, after using it I’ve found that it is also a very well structured library and easy to use. I haven’t had as much experience with it as I had with CakePHP, but so far it fits my needs very well.

So that’s my choice for the server side technology, Yii.