Wednesday, September 29, 2010

Developing PHP Web Application with Zend Framework - First thoughts

I've been doing some PHP Development with Zend Framework using Aptana Studio IDE in the past few weeks.

During the past year or so, my work was primarily with Java EE / Spring Framework and Ruby on Rails.

So, there have been some differences in experience.

Good things

  • It will work on my hosting. Zend Framework requires PHP 5.2, which most hosting nowadays already support.
  • Quick setup... that's the PHP project. The framework, not so...
  • Pretty good manual. The Zend Framework manual is pretty helpful, and comprehensive. It's not extensive or too detailed, but it shows how to do basic tasks. The rest, you still need the Internet and some good luck.

Bad things

I think there are more bad things than good things.

  • PHP 5.3 won't be supported... yet. Most hosting has not yet installed PHP 5.3 due to a number of reasons (laziness probably one of them). So, forget Doctrine 2 and functional programming/lambdas/closures. For example, as of 25 Sep 2010 DreamHost still uses PHP 5.2.14.
  • Insufficient code completion. NetBeans, Eclipse, and IntelliJ IDE have excellent support for Java code completion. In PHP, not so. There is only limited support for code completion, and that's only for PHP and HTML. For INI files, XML, and proprietary data structures (hierarchical associative arrays)... you have to scour the manuals/Internet/tutorials/etc. Same can be said for Ruby on Rails, though.
  • Zend Framework has a very steep learning curve, and difficult to setup as a full-stack framework. This is more the "feature" of Zend Framework than PHP. Zend Framework is not a Ruby on Rails killer, and will probably never be due to different philosophy. It's fairer to compare Symfony to Ruby on Rails. It's probably fairer to compare Zend Framework to Spring Framework. Comparing Zend Framework to Symfony is like comparing Spring Framework or Java EE to JBoss Seam. However, I can see why Magento Commerce chooses Zend Framework... It's very flexible. I can imagine it's harder to tweak Symfony or Seam to fit your app, but Zend Framework and Spring Framework are built to be tweaked, mix-and-matched.
  • Doctrine ORM has to be integrated in manually. This is both a good thing (flexible) and a bad thing (cumbersome). But it's a bad thing for me because I think it should be easy to use Doctrine by default, and also easy to remove it when not needed. I still haven't set up Doctrine "correctly" in my ZF application, I'm too lazy, and that's ZF's fault. Symfony has done a better job at this.
  • Lack of important view/action helpers. By default, using the FlashMessenger is tedious, since I can only access it via controller and has to pass it to the view. Why not a flashMessenger() view helper by default?
I'll post more thoughts later on as I go...

No comments:

Post a Comment