CodeIgniter logoWhat better, on a saturday morning, than to write (or read will you say) about a PHP framework with a nice cup of java - the warm caffeinated beverage that is.

Saturday morning thought: the Java developers I know are like Jehova witnesses: they divert any programming conversation to “Java is the future, wake up from your slumber”. Java’s been the future for 10 years, yet it failed to make it into the present. But lets take another sip of coffee and digress no more…

While I personally (this is a personal blog after all) like Zend Framework for its lightness, speed and cleanliness, I rarely consider it for rapid development: I dislike the MVC, and tend to use Zend more like I use PEAR libraries. The documentation could be better too.

My love goes to CodeIgniter, a PHP framework developed by the guys at Ellislab. Setting up a CodeIgniter environment is easy as 1-2-3: Unzip (or untar if you’re a real geek), configure database, and take a sip of coffee (did I tell you I liked coffee?).

To the contrary of Zend, the documentation is a wonder: tutorial oriented while not cluttered by stating the obvious. The only thing that I could use sometimes is an API-style documentation, which is inexistent and leaves me off looking at their code.

The essential libraries are there, ready to be loaded and used: configuration, database, benchmarking, crypto, input, input validation, output, language, unit testing, and much more. Plus there’s a few very good contribs out there on their wiki and elsewhere on the web.

Enough propaganda, let’s be honest, CodeIgniter is not perfect:

  • Configuration and language files are PHP declared arrays, which makes them kind of hard to maintain sometimes. Plus I’m worried (although I did no benchmark yet) about the cost of multiple file inclusion.
  • The model object provides a lot of flexibility (actually, you do it the way you want), but flexibility is a double bladed knife. A real, functional yet flexible out of the box active record class would make rapid development rapider.
  • The cookie-based session class sucks: All your data go in cookies + Cookies are size limited = Problems. But there’s proven and true replacements in the contribs.
  • There is no “real world” caching class out of the box. Sure, there’s a caching class that caches, URL based, your output, and it works well if a URL always look the same no matter who visits it. But in that Web 2.0 world full of logins and “Hello Tommy”, it’s not the case. Yet, you can extend the output class by adding caching hooks.
  • The framework is still fully PHP4 compatible, which tend to make its Object Oriented code ugly. Let’s hope they’ll drop that sooner than later.

Yet, CodeIgniter stays my first choice. There’s more pros than cons, and we built a lot of libraries over time that ease the downsides.


If you like this acrticle, leaving a comment, Digging it, adding it to your del.icio.us bookmarks is always appreciated.

category PHP, Programming Saturday 23 February 2008
Del.icio.usTechnoratiBlogmarksStumbleUponFacebookBlogLinesReddit

Leave a Reply

CAPTCHA image