Kohana vs Cake vs Zend vs CodeIgniter vs Symfony
A popular question asked all over the internet is – “Which PHP framework should I choose?”. The likely candidates are Kohana, Cake, Zend, CodeIgniter and Symfony. There’s a very simple answer.
How are you prepared to learn this new framework?
- Cake: Good documentation, examples and community support.
- CodeIgniter: Good documentation, examples and community support.
- Symfony: Good documentation, examples and community support.
- Zend: Good documentation, examples and community support.
- Kohana: Limited out-of-date documentation, limited examples and limited community support. If you want to learn Kohana you will be expected to read the source code until your eyes bleed and you’ve followed so many magic functions that you’ll need to understand the major changes between PHP v4 and v5 and which ones Kohana has built its framework upon. It’s really fun tracking down functionality built on magic functions because there’s no text string to search for, such a useful way of spending hours on a Saturday afternoon. As long as you’re an advanced PHP v5 programmer and understand the intricacies of OOP you’ll have absolutely no problem picking up Kohana.
However, if you actually want to use a framework that’s easy to learn and makes your job easier of building that web application, you’d be better choosing any framework that doesn’t start with ‘Ko’ and end in ‘hana’.
I chose Kohana. Some days I regret it, some days I love it and sometimes I hate the arrogance of the Kohana developers that think it’s good to read the source code. Sometimes I feel like I’m simply stuck with Kohana because I’ve spent far too long learning how it works to go and pickup another framework. I think this anger is what makes so many other Kohana developers so belligerent when we post on the forums – maybe I’ll be like them one day too … when I’ve put in my time.
I didn’t realize that my flippant and somewhat exasperated post was going to be so popular on the Intertubes. Therefore, I feel a little obligated to actually help.
There are some much better reviews of the PHP frameworks around the Internet, some that go into excruciating detail, some that compare performance but most are biased. In fact, I’m not even going to bother wasting your time by giving you the links. I read them all before I chose Kohana and all I ended up with was more information and more confusion.
There are strengths and weaknesses to every framework and the best framework depends on what you want your application to do. However, do you really want to learn all of the frameworks? Thought not, you just need to pick one.
Code Igniter and Kohana are bare bones frameworks, they supplement PHP, support everything that you *should* be doing with a web application but little more. Code Igniter’s documentation kicks Kohana’s butt all day long and from one coast to another. This is probably why the community is larger and it’s easier to find the answer to your problem. However, it’s not as slick as Kohana or as modern but you’re at the whim and mercy of a few developers who don’t really care about making it easy. There is a level of arrogance and ‘leetness’ with the Kohana developers that comes with the territory.
Both Code Igniter and Kohana require the developer to have a good understanding of PHP. You almost need to understand the limitations of PHP to see and appreciate the value in Kohana or Code Igniter. I ended up with Kohana because I sketched out my own framework and found that around 90% of it was already done with these two.
Cake, Zend and Symfony are for the less hard core programmers. People that want to get a project done quickly, are not bothered about blistering performance and value good documentation. These frameworks are all very similar and good products with excellent documentation and support. But there’s a little more overhead than Code Igniter or Kohana.
My recommendation for anybody wanting to consider any of these frameworks is to look at your application, break off a small piece of it and code it in all of the frameworks. How easy is it to configure the framework? Connect it to your database? Do some error handling, logging and create a few views? How well does it handle form validation?
A lot of the frameworks use a blog as an example application which may or may not be realistic so be careful. I’d also recommend looking inside the framework and the source code. Every time I’ve installed a PHP script during the last 10 years there has always been some point where I’ve had to read the source code, maybe it was a bug, an error or something that wasn’t clear in the documentation. It’s only when you see what’s under the hood that you get a better idea of the engineering quality. Is it commented? Are coding standards applied? Does it make sense to you? Pick a method, say the database connection method, how does it actually work? How many files do you have to track through to understand how it works?