Home » 2010 » October

Choosing Zend Framework was a mistake

About 2,5 years ago at work we were still using PHP for new applications. With PHP being the language of choice I was looking at what MVC frameworks were available. At the time only Zend Framework (which was at version 1.5) seemed to be the only PHP5 framework. Aside from that it was a mature project and being developed by Zend made me decide to use it. I also reviewed the feature set at the time, of course.

Zend Framework has a steep learning curve but in my experience most OOP based MVC frameworks do. If I remember correctly I first used Zend Framework for an admin panel for a website. Aside from the time to learn the framework it sped up development. At the end I had created a nifty little admin panel for managing company profiles. Administrators were able to manage all accounts (information, pictures) and set-up permissions. A company could in turn manage its own details and pictures.

Programming with PHP became a bit more fun again. Zend Framework provided a mostly consistent API and came with pretty good documentation, although some parts lacked and still do at times.

Being convinced by Zend Framework I started working on the rewrite of a big internal application. This application was written in old procedural PHP4 code. That in itself can work, but only if there’s a decent structure. Which is what this application was missing. Basically it was plain old spaghetti code. Views and logic weren’t separated. HTML, styles, Javascript and PHP were tightly intermingled making it a pain to extend and maintain. The database scheme was a nightmare as well, but with it being a rewrite I could nicely convert it to something more sane and get it normalized. I used Perl and DBIx::Class for this by the way. I should have sticked with it…

It took about 4 or 5 months or so to fully rewrite the application. It probably could’ve been done in 3 months but as I said I found the learning curve for Zend Framework steep. I’ve even reported some bugs I found! Anyway, after several meetings with my colleagues we re-factored a lot of the application to get rid of old nasty hacks and incorrect work procedures of the old application. With the application being written in Zend Framework much of this was easy and fast to realize. Now, 2 years later we’ve added a lot more functionality. The application is still easy to maintain and to extend. And more and more plans are in the making for added functionality.

So, why is it that I think choosing Zend Framework was a mistake? Of course, it’s PHP but as I posted in earlier rants is that only recently I got the green light to use Perl instead of PHP. One problem comes from PHP though. With their latest release in the 5.2 series they suddenly announced end-of-life of PHP 5.2. Long before that it was announced that Zend Framework 2.0 would use PHP 5.3 exclusively. I knew that. But with instantly declaring PHP 5.2 dead and deprecated supporting Zend Framework 1.x after releasing 2.0 doesn’t seem to be required anymore… Why? Because after they’ll release Zend Framework 1.11 they stop doing major releases of the 1.x series. Even if I would be able to use PHP 5.3 it would be a lot of work to refactor the code to be compatible with 2.0.

Now this doesn’t directly imply that Zend Framework 1.11 will stop receiving updates in the form of minor releases. But looking at its history I fear the worst. At one point it was said that the current and the last 2 major versions would receive security updates. Out of 2 times this happened once. The second time it was supposed to happen only the current and last version were updated (I believe this was version 1.10 and 1.9. Luckily I already upgraded tot 1.9 when this happened).

Talking about upgrading, moving from Zend Framework 1.5, 1.6, 1.7, 1.8, 1.9 and 1.10 hasn’t always been painless. A couple of times sudden changes to their API have been made. At some times temporary backwards compatibility was provided, but not always. But that I can forgive, that’s why they’re major releases.

So currently I’ll probably be stuck (as in bug fixes and security updates) with Zend Framework 1.11 when it’s out. Zend Framework is a open-source project so I could always fork the project myself and customize it myself for our own purposes. Even so I’m disappointed with the course Zend Framework went (or seems to be going). The biggest problem with Zend Framework I think is that it’s more of a big collection of classes than a solid framework. Don’t mistake me here, most of the components are very solid. But if they would’ve kept the core small (that being the MVC part and related components) and had moved most classes to the ZendX namespace, such as the webservice classes, they could’ve kept the major releases to a minimum.

WebService::Rackspace::CloudFiles 1.01 released

I’ve just released a new version of WebService::Rackspace::CloudFiles, namely version 1.01. It should appear on your favorite CPAN mirror soon. If you really can’t wait you can get it from GitHub.

This releases fixes some issues with HEAD requests. Although the module fully implemented the specification supplied by Rackspace it turned out that their specification wasn’t up to date. In short what happened was that instead of returning a response code of 204 with HEAD requests they would in some places return a 200 response code. Instead of checking for these exact response codes (for HEAD requests at least) the module now accepts a Successful response (2xx).

I’ve reported the problem with the inconsistent response codes at Rackspace and they’ve told me that all HEAD requests will be returning a 200 response code in the future and that they’ve yet to update their developer documentation.

Anyone using either WebService::Rackspace::Cloudfiles 1.00 or any version of Net::Mosso::CloudFiles I recommend upgrading to this new release as both modules aren’t fully working anymore.

1 year existence

Exactly a year has passed since I started my blog. Time flies by fast I guess. In this short year I’ve moved my blog from a shared host to a Rackspace Cloud Server. After running it there for a few months I’ve moved to a proper VPS from Tilaa, which I’ll probably upgrade to get some more memory.

I’ve been writing some Perl posts, announced several BlitzMax module updates, blogged about random stuff and kept track of a bucket list.

So far I’ve written 49 posts (including this one) and I plan on writing more in the future. All depends on my hands though. But we’ll see.

Stupid hands of mine

I feel like I should blog a bit more, but generally don’t have much to say at the moment. Which has 2 causes I think. The first is that small things end up on Twitter and the second is that I can’t get much done anyway since I’ve been having trouble with my hands. This problem with my hands is already annoying me for 6 months and I still have to wait 1 more month before a specialist at the hospital will take a look at it. To be honest, I don’t really expect anything to result from the tests to come.

Aside from it influencing my hobbies it also influences my job. I can’t get stuff done as quick, or at all, as I used to. Luckily my boss says he understands and wants me to take it easy and look out for my health. But, as a fellow programmer I ask you: how do you program slow? For me that’s not really possible. I either write code, or not at all; 1 or 0. I can’t code “slow”.

It’s really starting to piss me off though and the pain is starting to get worse. Already whilst typing this I’ve being taking a few breaks. I really want to spend some time in investigating Ext.JS and Node.JS. It’s also time to finish the last bits of Maximus-web so we can finally do some beta testing with it. I also miss playing the guitar regularly. On a good day I can play 5 to 10 minutes. After that I can forget about it for some days.

I’m afraid all I can do is take it slow and hope my next hospital visit will bring some good news.