PHP frameworks… a serious issue

Several years ago a new framework called CakePHP was released and I was quick to jump on the band wagon. The promise of having base code that does 90% of the work for you was too tempting and we quickly got burned trying to perform more complex SQL queries – hitting the boundaries of what was possible and having to hack our way around it. Ugh.

Still, when you go back to writing an MVC style web app from the ground up you quickly realise that life would be much easier with a framework. A year or so after CakePHP I had a go with CodeIgniter and found it’s less strict Model paradigm easier to work with as you could just pass straight SQL to your database. Sure it lacked some features but it was easy to work with and easy to pick up.

Then I became freelance and did a bunch of work with WordPress, which I really like but it’s not a framework (though I do think it’s under-used and underrated).

So, as of August last year I started a new job where we use Zend Framework. My first impression was ‘wow, this is cool – very professional!’ 6 months in, and though I’ve not used it lots I think I can safely say it’s nothing like Cake or CI – it’s far more complicated, there are no walk through guides – you must invest good time learning it (something which there wasn’t time for me to do..)

I now know enough about ZF1 to get by, but last night I had a look at zend framework 2.. it appears as though a whole new level of complexity has been added. I spent a couple of hours trying to figure out what the hell was going on and (for the time being) gave up!

I concluded a few things:

  1. Zend Framework is a ‘nuts and bolts’ framework.. it feels much more like a bunch of helper classes to help you make your own framework. This is flexible, but complicated and time consuming.
  2. Things that are complicated are more easy to break.
  3. Zend Framework is nothing like the other frameworks out there. It takes a long time to develop good things.
  4. The learning curve is steep. Steep enough to make you wonder if it makes any sense for a business to pursue it..imagine if all your future employees need to spend 2 months learning something before they can begin work?
  5. Following on from 4 – if other companies/startups etc. aren’t using zend framework because it’s too time consuming for creating websites compared to other frameworks then does it make me valuable as someone who knows ZF? I guess you could look at this one in two lights really. In some ways it could make me more valuable!
  6. One worrying thing about working with ZF1 was that different people on the team approached similar work in very different ways because of the flexibility ZF offers.. one person used Zend_Db_Table where another might use something else.. one person may have written a wrapper for something, put something in a library, a service or a base controller – things can quickly get out of hand.

Food for thought, but it’s becoming apparent that investing your time in one framework is a very serious thing to do.. everyone knows PHP, but when the frameworks become almost as complex as the language itself it becomes a serious investment of time for a web programmer.

I’d very much appreciate people’s comments on this :)

Please note: I’ll be revisiting this post on and off as I gain more experience with both ZF1 and ZF2 and I’ll be looking into other frameworks such as Yii and Symfony over the coming months.

4 thoughts on “PHP frameworks… a serious issue

  1. I’d highly recommend checking out Laravel. I’ve only used it for a couple of small scale things, but it all made so much sense; I actually really enjoyed building with it!

  2. I am going through same learning curve and doubts, especially when I realize that co-worker has developed his own framework on top of Zend, so what he is using looks little like examples or tutorials. There may be productivity gains eventually, but every new request from the business turns into an exercise of refactoring and tool building. In the end I wonder if it’s about job productivity or job security.

  3. Yes, I also agreed that ZF 2 requires much more time for developer themselves to experiment how exactly the framework is working, which takes much longer time to develop a simple system, the their auto generated documentation does not really help developers to understand how to use those components

  4. I’ve been using the Yii framework. There are loads of examples, web tutorials and user base submitted documentation. It’s really quick to get yourself up and running. There’s even a tutorial to get set up in the Eclipse PDT to help you get started, then a walk through of creating a reasonably featured site using the database!

    I’d come from a SpringFramework background and wanted something significantly simpler. Enterprise frameworks can do absolutely everything but most of the time you just need 70% or less of it.

    I’m an I.T. contractor in the UK and I’ve definitely seen an increase of the number of PHP jobs that are now starting to ask if you have experience with Yii. I think its simple controller/action structure, templating system and language support make it really easy to get your project off the ground, and as you learn more it gives you the flexibility of easy refactoring.

    And it’s free!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>