Hi everyone, our company is looking to decide on a framework to use going forwards, and its come down to Zend Framework or Yii.
So far we’ve come to these conclusions (bearing in mind these are drawn only from the limited experience we have in both):
Quite a steep learning curve due to sheer size and complexity of most of their libraries
No real focus on rapid application development, I’m inclined to think your average application will take just as long, if not longer, than using standard PHP libraries
Good focus on rapid application development, obviously the more time we save, the more money we make, at the moment this is the biggest appeal to using Yii over Zend at a commercial level
Lightweight and easier to learn, doesn’t try to do everything a la Zend/.NET, focuses purely on the important stuff
Doesn’t look like it’d be much of a transition from someone who knows Zend to come and learn Yii(?)
Better integration of permissions+filters into models, and models into forms, and forms into view. (I hate Zend_Form lol)
Yii is quite young and the perception is as its obviously a much smaller project there will be more bugs, required updates(?)
We will have to train all new staff to use Yii, it seems unlikely that people will apply already knowing the framework as it is relatively unknown
Less tutorials/code examples
I guess we’re looking for feedback on how accurate these conclusions are from people with a little more experience in both Zend and Yii.
My boss is also very interested to know how much time on average you would save by using Yii in comparison to standard PHP, and in comparison to Zend, what are your experiences? Are there any things that Yii isn’t so good at and would be better suited to ZF? What are the future goals and plans for the Yii project?
At the end of the day it could be my job on the line if we go for Yii and it later turns out to cause more problems than it saves, so I would appreciate your honest appraisal of both
The Yii authors have a long track record of providing excellent support and frequent updates for their other framework, PRADO, an award winning .NET-like framework for PHP. You have the option of using most if not all Zend libraries in Yii as well as other third-party libraries from other vendors. Many of the Zend libraries could be refactored to take better advantage of the Yii framework’s libraries. Yii is considerably faster than Zend.
The Yii authors have already announced their plan to take their existing RAD solution to a new more powerful level by building a web-based application or module. A separate project called Zii has already been spun off to support Yii’s JQuery-based widgets (coming in 1.1 after the first of the year). Note that the 1.1 svn builds are fairly stable at this point. I’m writing code now using 1.1 and update from svn several times a day.
If you have experience using other MVC frameworks, the learning curve for Yii is going to be short because you can relate what you already know to the Yii author’s approaches to framework design.
I code from a commercial point of view - I want my projects done as quickly as possible. Yii is phenomenal in this regard. I shared your concerns over the ease of hiring PHP programmers who would be proficient in Yii, then I decided it didn’t matter one bit - a decent coder will pick it up within a week, and if they can’t (or won’t) then I shouldn’t be hiring them.
I’ve never used Zend - I had a go at it when I was choosing my framework about a year ago - it just seemed to lack any sort of structure and I felt that it was more a collection of libraries than a development framework. Yii provides an initial structure for my applications, and forces me to code in a way that is automatically re-usable.
There has been a new release of Yii every single month for the last year. I came from Codeigniter which had a minor update in September that was the first since Febuary last year. Have a look at the change log and at the Google code repository to see how active the development team are.
As someone has said, you can use the Zend libraries either as-is, or with small modifications. If I need to extend Yii I tend to go and look at what other frameworks have and just cherry pick the best looking bits.
Cheers guys, sounds good.
What about productivity gains, is anyone able to quantify roughly how much time using Yii has saved them over the length of a project in comparison to what they were using before?
And has anyone hit any walls/limitations within the structure of Yii that has stopped them from achieving something which otherwise wouldn’t be a problem?
I think my boss sees it as only being worth the risk if we’re able to do a project at least 20% quicker than using ZF.
First project with Yii/Zend/any other framework is usually at least ×1.5 times slower. Next projects will be significantly (about ×1.2 each time) faster.
I started with Yii about two months ago, with quite some generic programming experience (both commercial and academic) but never having done anything MVC related. Currently I’m developing a base platform for our company to develop corporate social networks on.
I love Yii. I think that even with the amount of learning involved, the development process is still faster than if I coded the app from scratch, and it is definitely going to be easier to maintain. The way Yii is set up makes it almost impossible to write duplicate code, and if you change something in your database (add or drop a table column, for instance), Yii automatically adapts. The input validation functionality of CModel and the usage of PDO and parameter binding by CActiveRecord make your operations pretty much safe by default so there are a lot less security issues to worry about.
One thing that hindered me a little was the limited functionality of active records. It’s impossible to create a model based on a view for example, since a view doesn’t have a primary key. More complex SQL (such as nested queries) are hard (or even impossible) to implement with Active Records, though you can still use DAO as fallback, of course.
I think I saved around 20% of my time even on my first project using Yii (though it is a big project, you’ll save less time if your first project is small), and I think we will have a lot less support to worry about due to the standardization of a lot of code.
You’re right that Yii is a young project and I have indeed encountered my fair share of bugs and missing functionality along the way. These forums can be a lot of help, and as others said before me, the release cycle is still pretty short, so that hasn’t been a showstopper for me.
But the best thing for me is that I’m still discovering functionality in Yii that will make my work easier. I’m having way more fun than I used to have, doing this
I worked a lot with Codeigniter which is more like a marketing strategy for Ellislab desired to bring more customers over to expressionengine rather than a supported framework.
I also worked a little with Zend which seemed very daunting due to a lot of configurations involved. It’s review is pretty strong though so I won’t say it’s bad, not at all, just not on my taste.
Yii is what I ended up with. The learning curve for a newbie is a little bigger but you will get a smile on your face every time you discover something new.
Qiang is doing a pretty good job and I love the way he thinks at a framework. More, I think he’s done with Yii all the things that were missing in PRADO which was/is a highly respected framework also.
I just wish zii was more powerful and had more libraries like payment integration and all that repository juice that Zend throws on the table.
Just to clarify: Using Yii doesn’t mean you can’t use ZF stuff in your apps. Yii is very careful not to pollute any namespaces so you can easily integrate any ZF component you like. So if you find ou that Yii is missing something that ZF provides: Use the ZF component in your Yii app.
This slightly creates a dependency to something we didn’t chose from the very start. I have my own reasons not to use ZF and the same reasons apply in this case. When you pick a framework you obviously do a little research and compare with other existing frameworks so I didn’t picked Yii just to have ZF compatible. It’s crazy to update and connect 2 frameworks just to have a working application done.
Au contraire! It’s not crazy at all, given the very nature of ZF: “loosly-coupled components”.
And yes, I have experience with both Yii and ZF, look at my review over here.