Relooking at Frameworks


So today my partner and I really sat down to talk about the issues we've been having with CakePHP and to start the decision making process.  We once again started researching the various framework options, including talking about the potential cons of using one of the "dead" ones, like CodeIgniter.  As part of this process, we found a lengthy video on Lynda.com that goes through why to use a framework (and when you might not need to), the types of frameworks, and so forth.  For most of the video, though, it takes a deeper look at four frameworks (Zend, Symfony, CodeIgniter, CakePHP) including general details, pros, cons, and a good look at how apps built with these frameworks will look, be organized, and then the actual code.  It is about 2 years old, but it is still a pretty good video to watch. 

The first covered was Zend. We both found ourselves excited and surprised.  Zend sounded exactly like the sort of framework we really want and would like, including how models are done and the "code generation" mostly being skeletons where we still write most of our own code.  It seemed very flexible and was certainly way more "legalistic" than others we saw. Honestly, we couldn't understand why so many people said it had a huge learning curve beyond it being really big.  Now, the tutorial covered v1 rather than v2, so it could be that with v2 they completely changed everything and took out what we liked so we will need to look into that.  That said though, I suspect we will be trying this one out next as it was very much like Mach-II. 🙂

Symfony had some interesting features, but the bundles aspect was very confusing and it seems to require a very large amount of configuring and command-line code generation.  Like CakePHP, though, it is a full-stack framework so that isn't entirely surprising.  It is far more daunting than Zend appeared to be and much of the code felt confusing. The available dev/production environment flips and the dev bar is a nice feature though.  As it utilizes Doctrine, the video also covered that as well.  This also seems to use a lot of command-line tools and it seems like with Doctrine, it also makes your DB tables for you rather than you doing it yourself?  Checking the docs, it seems this is strongly preferred though Doctrine can "reverse engineer" an existing DB to some degree, but only with 70-80% handled and a lot of manual fixing required after.  For sure, Symfony would have a very high learning curve – we were looking stupefied by the end of the example and had to go get lunch. LOL

In the intro to CodeIgniter, the video host notes that is is relatively straightforward and very flexible, and that it requires more hand coding as it has few RAD tools, which are fine without.  It does have looser structure, which is not something we mind much as we have our own internal structural conventions that would keep our apps from being overly disparate. As mentioned in my last post, CodeIgniter is "dead", though this video was made before that was announced so it wasn't listed as a negative point.  It seemed to be the easiest of all the frameworks to get installed and running.  Though because it does have a "whatever works" mechanism, it doesn't have some basic features by default.

For CakePHP, we just watched the intro part to see what pros/cons they would mention.  He noted that a regular criticism is its automagical nature and more rigid, specific conventions that you cannot break out from easily. It isn't easy to do deep customization. You have to use a lot of specific naming structures because of all the stuff that happens behind scenes, and of course it has a lot of RAD tools, including scaffolding, and the "bake" command. Though he said it was "quick to learn" he also noticed it was easy to break the whole app if you misname anything or violate Cake's structure requirements.

I think watching this was a good use of our Friday morning and it helped us realize that the issue may not be so much with PHP frameworks is our having only looked at full stack type frameworks without realizing.   At this point, I think my partner and I would completely agree that we do NOT like "full stack" frameworks, rather for our coding natures and application design preferences, the more loosely coupled "use what you want" glue frameworks are more to our taste. 

We then discussed Zend vs CodeIgniter and compared the two.  CI is lean and certainly very easy to get going, but it's almost too lean.  Zend seems very flexible and has the sort of helpers that we do like and would use.  It also has the benefit of being "alive" and active, as we suspect our boss would very much be like "you picked a dead framework."  So next week we'll be installing Zend framework on our dev box and giving it a whirl.  So look for future posts on Zend to come, and here's hoping it goes better! 🙂