ucantblamem

Archive for July, 2007

Ignite thy code

3rd Jul 2007

The development team at SM2 has had a bit of down time this past week, which couldn’t have come at a better time considering the joyous news from the Joomla! camp recently. That’s not to say we’ve been lying down on the job mind you… We have been very busily researching development frameworks, which has been a lot of fun. Fun, because it means we have a clean slate and we can make a discerned decision about the environment we will be working with for the coming months (and years???).

There is no shortage of PHP frameworks or CMS’s out there, let me assure you, but having been burnt by the GPL we were able to cull the list pretty significantly. After a quick scan of the options we were pretty convinced that CakePHP would lead us out of the valley of the shadow of death. As a practical test, we rebuilt one of our internal systems with pretty impressive results! However, come Monday a wildcard entry fell in our laps and Cake suddenly had a worthy contender.

Code Igniter (the framework behind expression engine), has a very small footprint with every feature you want and none that you don’t. Today we spent half a day learning the framework and rebuilding the entire Musicadium site with it. Not only did we learn a new framework and build a site in the new framework in less than half a day, but we also built our own extensions and helpers with very little fuss. To compound our joyful discovery, we found a bridge from CI to Joomla!, that with a few tweeks should help us to transition smoothly.

CI uses an MVC paradigm (as does every other framework today) coupled with a bunch of very handy libraries, it allows you to include tools as you need them (rather than include everything up front). What this means is that memory usage is extraordinarily good. As an example, a page render from the application we built in Cake used about 3.3Mb of memory, whereas a page from the CI application used 0.63Mb of memory (Joomla! uses about 3 or 4 Mb).

I think the thing I like most about CI is that it doesn’t try and force you to use really obscure classes and methods to do everything. While I was programming in it, I didn’t feel like I was using a framework, which is very refreshing.

I love Rails (you probably know that already), but there is a learning curve to it. I read two books, about a 1000 words pages in total, watched many screencasts and read much of the Wiki, yet I still wouldn’t say that I’m a proficient Rails programmer. In contrast, I simply glanced over the CI user guide last night and I was able to accomplish quite a bit in a short space of time. Granted; that I am pretty well versed in PHP and MVC, but I still attribute a lot of the speed to the framework.

Thinking about it, it is interesting that we ended up building our own libraries (in the first two hours of using the thing), I guess you could argue that the framework wasn’t sufficiently catering for our needs, but honestly, building libraries was an incredibly painless procedure and as a matter of fact, I really enjoyed it.

There is one other reason that this framework has me excited though… As Kindalogical was winding up at the end of 2005, we were just starting to use our new CMS “KindaContent”. It was very young, with VERY immature programming behind it and ever since the day we closed down I’ve dreamt of all the things I’d do if I rebuilt it. The scary part is that what I’m seeing in CI is a lot of the ideas that I’ve had over the last few years, rolled up into a polished framework, maintained by someone other than myself, with a non-GPL license! :P

I don’t want to go through a lengthy run-down of the framework and it’s pro’s and con’s. I mean, I simply couldn’t do that, I haven’t been using it long enough… BUT… First impressions last, as they say and first impressions are very good! I don’t think we’ve finished doing our evaluations and there’s a good chance we may not even end up using CI as our number one framework, but it’s a great little discovery which should come in handy at some stage.