Seriously, Keep it Simple, Stupid


Seriously, Keep it Simple, Stupid

Like Scott, I spent last week in Portland attending OSCON. The first session I went to was a joint talk given by Rasmus Lerdorf and Thomas Sha. Rasmus is a Yahoo! software architect and the creator of PHP. Thomas is the head of YUI development. They spoke about strategies for helping Javascript and PHP developers work effectively together. They covered data exchange between the two languages, XSS and XSRF security best practices, and gave a great introduction to the YUI Javascript library for PHP developers wary of front-end coding.

However, what interested me most was the ongoing commentary Rasmus interjected about his own coding style. In between his main points he would show samples of his own code and desire to keeping things as simple as possible. He offered a pragmatic way of coding that really struck a chord with my own style.

I’ve always shied away from large, cumbersome MVC frameworks in favor of my own simple, stripped-down code base. I’ve explored frameworks like CakePHP, Symfony, and Solar, but each time I come away thinking that was a lot of work for very little pay-off. To be honest, I’ve often felt ashamed and a little embarrassed for not using them. So many people do I feel like I must be missing something. But each time I start down the MVC path I quickly retreat when I realize I can accomplish the same thing faster and with less work using my own collection of code.

Only recently have I begun championing my simple development methods. Earlier this year I open-sourced my personal code base on Google Code – calling it the Simple PHP Framework. Let me get this out of the way right now: I only call it a “framework” because that’s what people search for in Google. It’s not a framework – it’s a “foundation”.

Sitening has been using this code internally for our own projects and client work for about nine months. It has served us well, but I’ve been hesitant about publicly announcing it because I still feel the stigma of being a non-MVC programmer – an anti-framework kind of guy. I’m announcing it now because Rasmus’ talk boosted my confidence. He highlighted his own minimal database wrapper  and spoke against automatic code generation – something I’ve long been wary of and a key reason for my dislike of Rails. Near the end of his talk he summed up his (and my) feelings when he said

Doing things my way may not be right for everyone, but I’ve worked on some pretty complex projects and it’s served me well so far.

And so with that said, I’ll make my own disclaimer. The Simple PHP Framework isn’t for everyone. But if you’re a web-design shop like Sitening, with multiple client projects open at once, having a standard development methodology and code base is key. It means any programmer can jump on board and feel comfortable working on an unfamiliar project. An added bonus is the one-to-one relationship between browser URLs and PHP scripts you must adhere to. Not piping every request through a monolithic controller means our designers spend less time worrying about templates and more time building out the HTML they’re so talented at creating. I’ve yet to see a framework or CMS that offers a work flow as natural and easy to use for designers.

You can check-out the latest copy of my PHP framework with SVN using the command below:

svn checkout framework

For more info on Rasmus’ anti-framework thoughts, here’s a blog post he wrote on the subject.

Comments are closed on this post