Professional CodeIgniter

(singke) #1

Introduction


When I first encountered CodeIgniter, I was pretty much at the end of my rope.

I ’ d spent seven years building up a thriving little web development group and had hitched my little
wagon to various technologies (like SMARTY and PEAR), and things had run very well for a long time.
And then it happened. What is “ it ”? Well, “ it” wasn ’ t exactly any one thing that you could point to and
say, “ There, that ’ s the problem right there! ” It was more like a combination of things. Regardless, “ it ” hit
me with the force of a torpedo, and I felt my professional outlook implode.

I ’ ve shared my story with lots of developers over the past year, and they all seem to agree that in the life
of every web geek comes a moment of clarity. This happens to us whether we ’ re the worst decision
maker in the world or some kind of digital wunderkind.

What am I talking about? I ’ m talking about some kind of tipping point where you look at everything
you ’ ve done, and you don ’ t want to deal with it any more. I ’ m talking about making one more really
great choice (about architecture, performance handling, security, blah, blah, blah) and putting it in the
box with all your other “ great choices, ” and what you end up with is a box full of complexity, a kind of
reverse Pandora ’ s box of confusion and mischief.

The upshot is pretty simple. You end up with extremely complex code that you can ’ t understand. Your
mind can ’ t stretch around all the hundreds (if not thousands) of little changes and one - off decisions
you ’ ve made. You can ’ t even follow all the includes, the third - party modules, and the classes embedded
within each other like Russian Dolls. In point in fact, you end up with the Thing That Cannot Be Uttered:
extremely complex code you don ’ t even want to deal with.

And the customers that come with that code, who quite naturally want you to make things better, suffer
from it. Big time.

So it was with me, as I contemplated the tens of thousands of lines of PHP I ’ d written with such good
intentions. If you ’ ve ever had the pleasure of working with PEAR and SMARTY (and other similar
technologies), you know that they solve a lot of problems ... but they also bring a heinous level of
complexity to even the simplest little web application. And all of it was hanging around my neck like an
albatross, and boy, did I want to cut that sucker off and start over again!

But where could I go in my hour of need? Who could help me? Was there any way out of the
complicated Rube Goldberg machine I ’ d built as my little fortress of certainty? At the time when I was
feeling the most despair, there was a lot of media exposure for Rails. Hmmmm. Could this possibly be
the answer to all my problems? I bought a few books and started playing around a bit. I liked Rails — it
has a cleanness to it that makes you feel all giddy when you look at it, like buying a slick new sports car
and driving around town with it so everyone can see how fabulous you are. It was easy to use, too, and
you could get things done really fast.

But then, suddenly, the first - date warm fuzzies started wearing off. I realized that I was a PHP
programmer and that I ’ d spent years developing solutions in that world. There were very few gotchas
left, the learning curve was nice and pleasant, and it had been years since any of my customers had felt

flast.indd xvflast.indd xv 6/10/08 5:39:52 PM6/10/08 5:39:52 PM

Free download pdf