MVC Frameworks and modern web development
Lately I’ve had the pleasure of playing around with Ruby on Rails, undoubtedly THE name that comes to mind when you ask about rapid application development in Web 2.0.
My first impression was that it was going to be a pain to learn the ins-and-outs, and that I was in for a steep learning curve as I had to both learn the Ruby language, and master the MVC framework Rails at the same time. Coming from a PHP background I knew there was a lot of stuff I would have to learn (and unlearn, in a manner of speaking) in order to program effectively in Rails.
In truth however, I found it easier to get up and running with Rails than I did with Symfony, which is basically a PHP MVC framework that mimicks Rails in terms of its functionality. Symfony is itself, however, a brilliant MVC framework and probably the closest thing to Rails I’ve found for PHP.
With Rails and Symfony, you start out by designing your database schema, and then can use a number of command-line tools to scaffold your application, either by creating just simple controller classes or going all the way and letting the framework build pages to provide full CRUD (Create, Retrieve, Update, Delete) functionality, which you can then go through with a scalpel and paintbrush and customise to your liking.
In essence, these two MVC frameworks provide all the functionality and libraries needed to instantly turn a YAML database specification into a working application in a matter of minutes.
Why is this SO AWESOME? Simple: it allows developers to focus their attention on delivering a product based around their core business model, rather than wasting time dealing with fundamentals. Think of it as building a beautiful house out of existing materials…. plaster and timber for the structure, concrete for the foundation, paint for the walls etc. as opposed to building a house by heading off to the nearest timber forest, cutting down trees, cutting the wood to shape, treating the timber, mining limestone and other minerals to create plaster, concrete etc….. you get the idea.
Software development has always worked like this in a way… frameworks get more and more sophisticated, common controls and elements are packaged with development environments to make rapid application development simpler and more effective etc, but it seems that frameworks such as Rails and Symfony go one step further, because just about *everything* you could possibly need for an application is already there, or readily accessible as a plugin, and you can turn a nifty idea for a SaaS application into a reality in no time at all.
Both Rails and Symfony are supported by a fiercely evangelistic community of developers who provide plugins for free to solve a whole host of common software development conundrums, and both are supported by terrific documentation… I have been able to assemble a basic Rails app from scratch simply by following the Ruby Guides. Not bad for somebody who’s never written a single line of Ruby code in their entire life.
There’s one framework I haven’t mentioned yet: Zend. There’s a good reason: I don’t think the Zend framework deserves the title “Framework”. I don’t like Zend. It feels bloated. It feels poorly documented. It feels badly coded (and I’m not the only person who feels this way). To me, it feels like the Microsoft of MVC.
Everything about Ruby and Symfony screams “simplicity” to me, like the creators intended to turn programming back into a graceful art, and to make people truly passionate about web development. Symfony and Rails are the Zen gardens of web development: minimalistic, spiritual, beautiful and closer to art than software development.
Zend doesn’t really “scream” anything, so much as make developers scream at how frustrating it is to use and develop applications. I’ve seen Zend code… it’s like looking into the gates of hell.
I’ll stop bad-mouthing the competition now, and simply close by saying: if you’re passionate about web development, and want to learn a framework that makes developing web 2.0 apps feel more like art than simply cutting code, I implore you to give either Symfony or Rails a decent try. Take a weekend to run through one of the guides. I promise you won’t be disappointed.