KillerPHP Blog

PHP, Zend Framework, Ruby and Web App Frameworks.

May 20, 2012

I recently had a conversation with a good friend of mine who has his finger on the pulse of the web app developer community – whether it be PHP, Ruby and even .Net.

So I asked:

Last we spoke, you mentioned that the Zend Framework was in a do or die situation?

Can you elaborate on that? I am just curious.

Stef

His answer:

Something I’ve noticed is that the idea of a monolithic framework is kind of dying. If you look at ruby on rails, it started off as a monolithic code base maintained by 37 Signals. Because of that, they wrote the Javascript layer, the ActiveRecord implementation for persistence, the view-controller architecture etc…

Rails 3.x is a completely different monster. They replaced their JS layer with jQuery. They replaced their ORM with Arel and ActiveRecord is now a thin wrapper around Arel. They replaced their web server archictecture with “rack” middleware. What this has done is standardized certain portions of the framework to the point where they are truly modular. In the rails community another framework will advertise that it’s “rack compliant” or “built on top of Arel”. What this means is that 37 Signals isn’t *the* ruby company and so they can specialize and delegate, while providing a strong brand that promotes software development best practices.

In the ZF community, ZF 1 worked ok, but it relied on a few anti-patterns (heavy use of singletons in order to ensure that performance wasn’t abismal). ZF 2 is trying to address that, but they have a really small team of strong PHP developers that are working on the core pieces (like the MVC implementation and the persistence). This has made the release of ZF 2 “just around the corner” for about 6 months now.

Also, because the people doing the rewrite wrote the first ZF, they want to clean up all their mistakes and so there’s a bit of ivory tower engineering going on (heavy use of dependency injection and inversion of control patterns), which will make the framework less friendly to beginners. Add to that the fact that Zend_Db was a huge face-palm and that people want integration with Symfony (a competing PHP framework) components, Zend is going to have to give some ground and start making some tough calls to deliver.

Finally, they HAVE TO DELIVER, because ZF 2 is written with the assumption that you’re using PHP 5.3+, which will be a huge shift for large code bases that haven’t seen a serious rewrite since PHP 4. If they don’t make ZF 2 a resounding success, the community around ZF will probably move to greener pastures (my money is on symfony or just not PHP).

my 2 cents,

… Some interesting thoughts, so I continue:

Very cool.

Now that a few years has passed, what do you think of Ruby vs. PHP these days? When we looked at it, I found the libs a little weak .. I imagine all those wholes are filled by now.

Stef

His response:

I think Ruby’s shaping up nicely for getting something done quickly and elegantly. There’s a huge aversion to ivory tower architecture, which I appreciate. I think that there are still performance issues on the whole that are being addressed, but now there are a lot of different ways of dealing with it (or even not dealing with it by using a cloud service like Heroku).

I would also look at erlang. Erlang is a whole different paradigm, but I could see it growing in terms of handling middleware development or places where you need high-volume, high-concurrent systems that are scalable. This is a language that I’m hoping to dive into in 2013, but I think Ruby / Javascript will be my bread and butter.

The Javascript framework wars have really heat up lately, and I would be looking at BackboneJS. It builds on top of jQuery to provide a very nice model for wiring events and writing views / models / controllers in the browser.

My final thoughts

My buddy has been developing web apps for years and has worked with several technologies – he like me, is language agnostic. We pick the best tools/language for the job, and we don’t get too religious about anything in particular.

So does this mean PHP is on its’ last legs or am I advocating Ruby? No, PHP is not going anywhere. I decided to post this just as food for thought … something that you can keep in mind as you develop your skills and your career.

Stefan Mischook
killerphp.com