Friday, March 28th, 2008

Perplexed by Web Frameworks

The latest LugRadio episode features a discussion about Django and other web frameworks. I found the feature interesting, but I have to admit that I find the subject of web frameworks somewhat perplexing. I have yet to fully embrace any such framework, although I have played with the Zend Framework. I think there are a number of reasons I have not fully adopted any frameworks:

  1. I am put off by having to learn all the new classes, structures and methods employed by said frameworks. Surely my time would be better spent actually learning more about the core language?

  2. I fear that using a framework would somehow stifle innovation. I am under no illusions of being the most innovative player, however, I find it hard to shake. I guess I am questioning where the innovation comes from if everyone is using the same framework?

  3. It is fun to write your own code, functions, classes and routines etc. I like to experiment with code, I like to make mistakes, before fixing them — it is this that keeps me interested. I would be concerned that using a framework would takeaway much of that.

Having said all that, I'm not totally opposed to frameworks and I think they have their place; three PHP frameworks of interest to me are:

  1. Zend Framework: http://framework.zend.com/
  2. CakePHP: http://www.cakephp.org/
  3. Symfony: http://www.symfony-project.org/

I am going to look into the above to see what they have to offer; however, I think I will probably continue to hack together my own code for a while to come.

Tagged with: php, programming, webdesign


7 Responses to “Perplexed by Web Frameworks”

  1. greg wrote,

    If you're going to look at php frameworks I would like to suggestion codeigniter. It tends to stay out of your way more than the others and has great documentation. Although I have migrated to the dark side and use RoR now.

    http://codeigniter.com/

  2. Vincent wrote,

    I'm an avid user of the Zend Framework (CodeIgniter looked interesting but ZF was a bit cleaner a pure PHP 5) and am really enthusiastic.

    It does not take away room for innovation, since it's only core classes it provides, i.e. you don't have a full website by just installing ZF. It is indeed fun to write your own code, but not when you're writing similar stuff over and over again. Using ZF for the common tasks allows you to spend your time on the really interesting new stuff. Using a framework the variety is much greater.

    All in all, the time spent learning (which won't just teach you how to use the framework, but also how to write better code in general) is absolutely worth it, IMHO.

  3. Wil Sinclair wrote,

    I agree with Vincent completely, although I'd like to make the ramifications of Zend Framework's use-at-will architecture a bit more explicit. The idea is you can take it, leave it, or extend it. If there are parts of the application you'd prefer to code yourself, then we believe you should be able to do that easily- the framework should get out of you way and fast. But there are likely parts of the application that you don't want to write yourself, and that's where one or more of ZF's loosely coupled components can help out. On the other hand, many developers would prefer to code only the business logic and specific infrastructure necessary for the application at hand. They might find that ZF components save them time or provide them a better base upon which they can build a better application. So we strive to provide everything they would need to do this. Others might find that are components are almost what they need, but not quite: they're likely to take advantage of the many extension points built in to ZF as a result of our MO of building from the bottom up towards simplicity and more specific use cases. For someone who is hesitant to use frameworks in the first place, this might be more acceptable to you. In the end, I think you'll find our philosophy coming out strong in the code base. We think opinionated software makes all the sense in the world, but opinionated frameworks do not. And we're not the only ones. Examples I can think of in the PHP world include Solar and eZ Components. No doubt I'm missing other great examples. Glad to hear you've been playing with ZF. I'm sure you've also read about Rasmus' no-framework framework (http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html), but if not you might find that interesting.

    Best of luck whether you go with ZF, another framework, or on your own!

    ,Wil

  4. Vincent wrote,

    I in my turn can only agree with Wil. The loose coupling is excellent. Just today I decided to drop Zend_Db and start playing around with Doctrine for my database abstraction, and it is very, very easy to make the switch. And I've learned some more :)

  5. Philip wrote,

    Having read these comments, I'm still not fully convinced, although there are some strong arguments put forward. I guess I'll have to try it for myself, hopefully I will then develop a better understanding. As luck would have it, I am about to start a new project and so maybe I will give Zend Framework a try :)

  6. Vincent wrote,

    Be sure to keep us updated, whether you decide to stick with ZF or not :)

  7. Steve wrote,

    I've used CakePHP with some success. I find it a lot quicker than "reinventing the wheel" for each project.

Add Your Comment

Use the form below to add your comment. Markdown syntax is available. Note, comments are moderated by me for spam filtering. Alternatively, feel free to contact me privately.