For those who do not know what a framework is; it is basically a library that allows for rapid, consistent development of applications. It was a tough decision for me to start learning frameworks since we have already have developed our own pseudo framework which for the most part works very well for us and our clients.
Not all frameworks have the same benefits but some of the things that I look for are:
- Rapid development – It is important to me to be able to build an application in a matter of days rather than months
- Code community – A large community is great so you can rely on others that have likely been through some of the same pain. Healthy communities tend to share code which can be nice
- Built in tools – Some frameworks come with add on tools that can build the classes and effectively make life a whole lot easier
- Learning curve – If it takes a long time to learn, then it is likely that it won’t last the test of time; that said it is normal for an advanced programmer to take three months to learn just one framework.
- Stability and performance – For me it is important to have a framework that can perform under heavy stress. Many of our applications see a lot of traffic; its important to us to reduce server costs by writing code in an efficient manor.
Based on my criteria I narrowed my search down to Zend, Yii, CodeIgniter and CakePHP.
I ruled out CakePHP first because it is reported as being slower than the other frameworks and forces me to use a very specific convention.
I’m pretty sure Zend costs money which left me with CodeIgniter and yii.
In the end I picked yii. It was a tough decision because ci has a larger community as it has been around longer. Yii is non-specific, free, fast and seems to be gaining some serious ground. The tools that it comes with are amazing.
For example, I took my existing database structure for a user table and instructed the yii tool called gii to create an MVC structure with full CRUD capability. The final result was a working user editor that handled 85% of the functionality I wanted and I didn’t write a single line of code; it only took me a few minutes to do and I was very pleased with the result.
If you are interested in building web applications in PHP, I recommend learning yii; its a great way to build well structured, flexible, fast, compatible applications with less effort.