November 14, 2012

Symfony - Day 1 - Forgetting Zend


A little over a year ago I had my first introduction to the Zend Framework. Starting a new job, my first task was to rewrite an existing web app. The original app had been written years before and had leveraged a lot of Zend framework libraries, but I faced two challenges. First, the original developer was new to both PHP and Zend when he wrote it. And second, I knew almost nothing about Zend. I always like a challenge, but having never touched a PHP framework, or any framework for that matter, I wasn’t exactly sure where to even start. The app did it’s job, but was completely unmanageable, hard to read, and hard to improve. Requirements were stacking up for new features and they just weren’t going to play nice with the existing code. So I spent the first six months reverse engineering the existing app, learning Zend, and deploying a better version. Overall it was a very successful and rewarding experience. Using the full Zend framework allowed me to build quickly and even expand the apps feature list considerably in the process.

I’ve now completed two or three large projects doing things the Zend way, and although I’m pleased with the end result I’m left with a feeling that things can be done better. I read an interesting article the other day about PHP versus Ruby where Derek Sivers compares languages to girlfriends and how we often feel that one language is inferior to another. While certainly there are times when one language is better suited to a task, often times it is our growth as developers that highlight our ignorance and affinity for bad habits in the past. Rather than look on our past self negatively, we blame the language (or girlfriend) we were using at the time. I’m sure that I have not utilized Zend exactly as its designers intended. I’m sure I’ve written code that could be optimized. But I’ve gotten into a rut with the way I build applications in Zend.

It’s time to learn from another framework. I have a new project that is perfectly suited for this experiment. I’ve looked over the various frameworks that are out there and I’ve seen a lot of good things. I narrowed things down to Yii and Symfony and I just felt more at home in the Symfony documentation so I’ll give it a shot. Some may lament that decision for a variety of reasons, but ultimately if this app works and I’ve learned something new then I can call this process a success.

So now to figure out this composer thing…

No comments:

Post a Comment