Alex Hudson has written a good piece on Zend Framework 2, and why he’s moving on from Zend Framework. I was an active contributor to Zend Framework from 2006 until 2008, and I moved on also. In fact, I mostly moved on from PHP altogether, in large part directly because of Zend Framework.
I’d like to say it was because of the Java influence which is on its face largely at odds with the language it’s built on—but really, it was because I was tired of PHP and its ecosystem. I was tired of the weak typing (not dynamic typing), inconsistent function names, anything-goes argument orders, the generally poor quality of libraries and open source projects, the community values that led to both, the resulting difficulty in hiring good developers from that community… well, I could go on.
There were counterpoints to most of these arguments, and I made them to others. But eventually the weight of the problems added up, and I wanted options. Zend Framework seemed to be trying to turn PHP into Java, and although I hadn’t yet made a value judgment about Java I knew that wasn’t appropriate for PHP. It’s essentially a glue language like Perl, and the “PHP way” (such as it exists) is about lightweight, quickly-bootstrapped solutions. Otherwise, what is PHP good for?
At best, most developers see PHP as a hammer—not particularly fast or elegant, but it gets the job done.
Zend Framework highlighted these problems for me. It served as a stark contrast to the quality of other PHP components, but exemplified the schizophrenic direction of PHP as a whole since 5.0 (PHP’s SPL—its Standard PHP Library—is every bit as Java-like as Zend Framework).
I glanced at Symfony and some other projects, but what I really wanted was something that addressed my complaints: strongly-typed, consistent, good libraries and community, etc. Professionally I began writing Java, both with and without frameworks like Spring and GWT. At home I began writing a lot of Ruby, using the MacRuby project to supplement some Cocoa I had already learned using Objective-C. I also played with Rails 2 and Merb.
The Java started off well enough—I was creating the same types of complex multi-tier applications that I did under PHP, but this time backed by static typing and a huge library of components from Spring and Apache. But even after I was up to speed, development was slower. I had always heard how Java was heavy, but now I truly experienced it: Spring, a “lightweight” alternative to Struts, had so much explicit (and, to my mind, pointless) infrastructure setup that I was thoroughly disillusioned with it within six months.
I had already blogged about why I thought writing JavaScript by proxy was a bad idea, but I was questioning all my assumptions and so I decided to explore GWT as well. In the end, my experience was similar to Spring—it was all too slow. In the case of GWT I felt both too far removed from the end result and occasionally too near (when I needed to jump into writing native JavaScript using JSNI). This leaky abstraction was explained as a fundamental design decision, but never sat quite right with me. I knew it was necessary, and that was the problem.
At the same time, I experienced none of these problems with Ruby. During this time of exploration I wrote a variety of things: a parser library for a non-trivial binary file format, some GUI components using MacRuby, a website in Rails 2, and an API in Sinatra. I started looking into Merb, but learned it was merging with Rails and so started becoming familiar with Rails 3 instead.
Contrary to my experience in both PHP and Java, I loved every moment writing Ruby. Like Python, it is both strongly- and dynamically-typed. I found the libraries to be generally high-quality, and when they weren’t, the authors tended to be up-front about that fact. The community, inspired by the Rails philosophy, was constantly pushing the envelope by embracing the latest and greatest, almost to a fault. It had a good community that valued pragmatic solutions.
It’s four years later now and I still love Ruby. It’s not the best solution for everything, so I’ve continued to learn new languages (my latest being Python), but it’s generally my first choice.
I still occasionally write some PHP at work. There’s a lot of sighing involved. Zend Framework has some good components and when appropriate I recommend it as a library. I wish it were more modular.
I wouldn’t recommend the MVC—it’s slow, and it places things in the way of routing that should probably go elsewhere. Zend Framework architect Matthew Weier O’Phinney is a smart guy, but he’s trying to drag the PHP community almost single-handedly toward the PHP-as-Java point of view. Frankly, I don’t think it’s right for the community and I don’t think the community is that interested. I predict Zend Framework 2.0 adoption will be glacial. Most people probably won’t ever bother making the switch.
Like this post? You might also like
Coalmine, my centralized error tracking service for your apps. Coalmine captures errors and all kinds of helpful debugging information, notifies you, and makes it all searchable.
Check it out!