Why Yii over Zend?

Ok… not trying to start a war.  I really want to know business reasons of why I should go with Yii over Zend or whatever the 2nd largest PHP Framework is?

Note: I am new at PHP Frameworks so bear with me…

  • Let's ignore speed as a reason.

  • Let's give some concrete reasons why Yii is better?

  • I hear there are a massive amount of support libraries for Zend… Does Yii have equivalent libraries so if one chose Yii they do not start out way behind the eight ball

  • I know Yii is new in comparison to Zend (and some others) so would it be fair to say that Yii is lacking a lot that the others have and may not achieve the same things without another year of waiting for it?

Let me also say… if you don't have real experience between the two frameworks then please don't give an opinion based on marketing info or just thoughts.  I want to hear form those that have lived and breathed Zend or other major framework player and who have experienced enough of Yii to have an educated opinion supported reasons for your opinion.

Thanks you for your time!

I suppose there is no, or at least shouldn’t be, any business reason. It is all about preference, personal taste.

You asked us not to include benchmark difference, although that is a really important aspect when it comes to comparisons.

Zend Framework is generally said to be a library, a bunch of useful classes, not a traditional framework. I truly tried to rely on ZF by reading reference guide from cover to cover, looking for working examples, even by reading source code. What is my final conclusion? Zend Framework is a big mass of engineery code. It is intended to be perfect in terms of programming habits… but in the end, it doesn’t cut it.

Thousands of file operations, millions of repeated require_ones, unnecessary resource sacrifices. I’m not talking about speed - I’m talking about structure, convention over configuration, class-autoload requirements, which are insufficient in ZF. You get the point, I’m fed up with it.

On the other hand…

Yii provides a well-written, centralized way to manage even very complex applications without dealing with needless robustness. You always know where to look, what to extend, what to expect, how to fix bugs. The main developer, Qiang, decided to concentrate on up-to-date requirements instead of implementing hundreds of utility classes.

It’d be a lie, if anybody stated Yii knows everything. But you can have it know by adding third party classes with ease.

In my opinion.

Thanks for your feedback.

Reason for not wanting feedback on speed is because EVERYONE will say speed.  I just wanted to get more concrete reasons for using Yii over Zend or other major player product.

Thanks again for your response and I look forward to other responses as well.

easy, efficient, extensible

You’re welcome. I understand your concerns, however, I’d like to note that speed is mainly a consequence and not simply a reason. Everybody would say speed because they feel it, but might not notice the underlying concepts. So you can create slow apps with Yii, as well as responsive ones with Zend framework.

Yii doesn’t want to take advantage of PHP’s resource intensive class management features (as far as I know, it uses reflections only occasionally). Zend framework applies these shiny little possibilities as frequently as possible, because that seems to be the right way, but it isn’t. CodeIgniter on the other hand, doesn’t use classes as contextual wrapper (mainly because it is developed for php4).

Frankly, Yii is the golden path inbetween.

@PoL,

Have you read the ZF about page? It says "Zend Framework is based on simplicity." Is it? Ridiculous… Never ever believe advertisements.

for me yii is easy (is the only framework I want to saty in), efficient (I agree with all taht you wrote) and extensible (as we know)

Thanks again… one of the other areas I had concern with is community support.  Yes… I see there is a helpful community here… but when comparing the numbers of folks in the community it is definitely smaller than zend community.  This doesn't freak me out… but I do want to make sure there are many contributions being made to help my tool of choice to be the best it can be… and of course I will want to contribute once I get up to speed.  I have no doubts of the abilities of the author of the framework as I have read much about him… I just want to be a part of a community that is growing by leaps and bounds so we can all learn from one another.

@gsaunders: I suggest you try both to accomplish some common tasks (content display, form processing, CRUD). Choosing a framework means you will stick to it for a long time. So you really need to get your personal feeling.

Using Yii doesn't preclude you from using Zend. In fact, you are encouraged to use 3rd party libraries.

Check this cookbook article on how to use Zend components in Yii: http://www.yiiframew…oc/cookbook/20/

And check this extension on how to use helpers in Kohana framework in Yii:

http://www.yiiframew…hp?topic=1026.0

Regarding community and support, while the Yii community is still small compared with other more established frameworks, it is growing rapidly, and we are proud that our community is very friendly. As we are moving towards version 1.1 development and release, we will expand team to improve our support for using Yii. Right now, we keep a small team in order to keep the core as stable and solid as possible.

I have degree in CS, and read a C++ book back in college 6 year ago. That’s all I know about programming.

2 Month ago, I tried to learn CakePHP, but couldn’t get through the blog tutorial, because the tutorial really written by and for people who don’t really need tutorial, which reminds me of my stupid academic professors in Beijing.

Then I tried Zend, their document really really sucks, their configure file, bootstrap.php and front controller make me depressed, because they use “front controller” without giving an explanation, and I always confuse it with controller. I couldn’t figure out what is auto loader, and why they need to “load” class. The Quick-start isn’t quick at all. I watched 30 tutorials done by a Russian guy on Youtube, but still can’t get it. Now, I can talk with Russian accent, but couldn’t do anything with Zend.

Then I tried Yii, its document isn’t perfect neither, but the screencast is the most user friendly tutorials I even seen. They got me into the door. For this single reason, I’ll use yii, since no matter how good the rest are, if I couldn’t understand it, it’s no use to me.

But I am very worried about Yii, since I am a business person (MBA), and I know product leadership does not equal winning. Zend community is the most important aspect of Zend product. Zend Framework is not the key, and their product IS their community. Zend community provides extension, forum, books, evangelist, trainings, Q&A and projects which make everyone in the community stronger. It’s called type 2 network effect. Yii is weak on this.

Hope Yii can provide more user friendly screen cast like the one they already have!

I know, you said not to quote speed as the reason, but for me personally memory consumption was THE reason to switch to Yii. I write many crawlers and processing data is easier in Yii, than it would be in Zend + Doctrine.

I think Yii forum is not quite the right place to look for objective opinion :D

But back to the topic: I used Zend framework for a while, now I’m participating in Yii framework based project. Team picked Yii, because no one was familiar with Zend, and Yii learning curve is better (Yes, Zend quick start is a crap). I think this was right decision, since I enjoy using Yii, and project works well, but Yii framework is not better tool, It’s just the right one for this particular project. You always have to pick your tools considering needs of a project.

I like Zend’s database abstraction, overall control of a code better, not mentioning Zend’s library, that covers almost all common tasks. It’s strict feel of “right programming decision” allows to have confidence and clear structure when handling larger team of developers. I would defenetly choose Zend over Yii, for bigger, long-term project.

Yii has great template engine, great guide, Gii is awesome, and really saves time, when working agile on short/mid term projects, but in my opinion, it’s less future-proof, since not a lot of developers use Yii, and Zend is kind of a global standart, so adding new team members, when having project in zend, gives results faster, than it would for yii based project.

Our business decided to use Yii instead of Zend as the main framework even though we were very familiar with Zend. In fact Zend was the default.

They are both fret frameworks however I think they aim at different goals.

  1. We can use all Zend library components easily within Yii.

  2. Yii has a much more elegant component based architecture approach. 1 file with only a few hundred lines of code gives you property based configuration, mixin behaviours, and an event system.

  3. Zend tend to use very academic solutions that sometimes work well and sometimes are not practical. Yii always seems to favour practicality. Though this is more of a personal feeling.

  4. Yii has better code comments, the documentation in te code itself is superp making it very easy to follow. This is not always the case with Zend.

  5. Yii saves a load of time. As I have now had to use both Zend and Yii for projects, I can say from my own experience that yii saves a boat load of time.

  6. Yii community is great, very helpful and friendly to beginners.

  7. Extension library. Due to the nature of yii it makes it incredibly extensible. As standard conventions come with the framework, new extensions are pouring in. Download and go.

We use magento often for ecommerce sites. The amount of framework code in magentos core is quite incredible. I wish they used yii!

Just a few reasons I might ask around our office and collate a better list. We were all very happy with the swap to yii even though we had to go through the learning curve again.