Choosing a Framework (part 2)
The Final Four
Down to last four; CakePHP, CodeIgnitor, Kohana and Zend. The test is to get each framework to print ‘Hello World’ on its own ‘/hello/’ page. For each test I will record the time taken to:
- Work out how to complete the task, which will indicate how simple it is to use, and how good the documentation is.
- How long the script takes to execute, to measure the performance. This will be averaged over 5 attempts
CodeIgniter
Test completed in 15 minutes. I only had to use two pages from the documentation, One to print, one to remove index.php from the url.
Execution took 0.031 seconds.
CakePHP
Took an 1 hour. Far too much made of the installation. File permissions to deal with, database configuration, why?! Did I say i wanted caching enabled and connect to a database? Then when I finally got to writing a controller, it didn’t let me do a raw echo. So I create a view, and find it comes with a default layout?! Takes me another 15 minutes to look through the manual to find how to switch it off. Too much crap to get through.
Execution took 1.388 seconds.
Kohana
It was difficult to accurately analyse this one because it’s so similar to CodeIgniter, and I think it’s assumed that people using it are familiar with CI too. The documentation isn’t at the level of CIs, but it’s still very clear. Took me slightly longer to find how to print ‘Hello World’ and a lot more pages, but it came with an example .htaccess file to speed up removing the index.php in the URL. 15 minutes.
Execution took 0.039 seconds.
Zend
Zend took 30 minutes to set up correctly. It’s very much start from scratch with Zend, nothing is there for you. You need to create the directory hierarchy, and all the files within it outside of the library itself. However the documentation was excellent, and I knew where I was going very quickly, it just involved a lot of ‘admin’ to get there.
Execution took 0.078 seconds.
The Result
I had planned to do some more tests for the final four, but it wouldn’t be justified as I’ve already made up my mind!
4th place – CakePHP
Cake is a good framework no doubt about it. One of it’s main perks that everyone raves about is its automatic code generation dubbed ‘automagic’. I could see this being an advantage for a rapidly expanding website, and for experienced PHP developers, but for me though it’s like learning to fly a plane with autopilot.
Another problem for me is the documentation. For argueably the most complex framework of the lot, it’s poor.
Finally the features, or classes, that it comes aren’t as extensive as the other three frameworks. There are many third party plugins to be found in ‘the bakery‘ but they should be integrating some of the more useful ones into the framework release so you don’t have to go looking for them.
3rd place – Zend
Zend is a damn nice library of code, and has some great components like lucene search. In terms of flexibility in the applications it can produce I’d probably put it in the number 1 slot. The documentation is also brilliant, especially the reference guide and the quick start tutorials. At this level, it’s ultimately down to preference.
2nd place – CodeIgniter
Sooo we have a winner, but why did it pip CodeIgniter? CodeIgniter is brilliantly simple, flexible, but best of all it’s the fastest framework on the market. The documentation is good, especially the screencasts. It also boasts the advantage of working with both PHP4 and PHP5.
1st place – Kohana
As this is just an evolution of CodeIgniter you can get started using both its own and the CI documentation. Why is it better than CodeIgniter? Two reasons:
- It’s strict PHP5 and takes advantage of all its new features. This makes it more future-proof and robust for building object-oriented applications.
- It’s ran by a community as oppose to an organisation.
And that’s it! Enough writing, more programming!
Read part 1