So I’ve been developing website functionality for a long time; HTML and frames in middle school, to the more structured table-based layouts of high school, and eventually moving on to the now-accepted divs+css.
Discovering that the mystical internet was merely a collection of rendered static tags hosted by a computer somewhere completely changed my opinion of it all. What a freakin’ hack! I used to dabble in PHP back then, and all of my sites were on the unfinished/hacked-together level. But I was just a kid! Obviously I was doing something inexperienced that would be grossly overshadowed by the magnificent glory of real web development.
Oops, surprise. The most powerful tools of the internet are the unfinished, hacked-together works (although significantly larger in scale) than my youthful escapades into web dev.
And I’ve come to terms with this. The closest to elegance we can get when writing any internet-code is to wrap the ugly bits into pretty little packages that can be called with the minimum number of lines and parameters.
Which brings me to the best PHP framework ever, CodeIgniter. Some of you may say CakePHP or Symfony, but I disagree. CodeIgniter is the only framework I’ve come across that didn’t get in the way of my programming. I’ve spent years learning actual PHP code, so finding a framework that doesn’t interfere with my most basic of knowledge is a luxury. CI gives me the organisation and structure of the MVC, a readily accessible and informative documentation, and enough community support to really make it worthwhile.
When initially switching from my rudimentary PHP objects into CodeIgniter, I was able to port 90% of what I had written directly in, copy-and-paste. Everything worked, nothing had to be done automagically for me. As I learned more about CI’s abilities, I slowly cleaned up my code; abstracting away all those ugly mysql_connect() and mysql_fetch_assoc() calls into the awesome simplicity of CodeIgniter’s $this->db->query().
While more on the virtue of the Model-View-Controller scheme, I love that now I’m able to completely separate my generated HTML code and CSS layout into entirely independent files; I can now radically change the appearance of my site without ever touching the underlying code that gets it’s hands dirty in the database.
I’ve come a long way from the little kid who wrote his first website in frames on an angelfire page, and I think that finally I’ve reached the elegance of my initial assumptions.