Benjamin Curtis

Speculations on Web Development

Ruby on Rails and PHP

| Comments

It’s hard to be a web developer these days and not hear about Ruby on Rails. I’m not quite ready to give up on PHP yet, for reasons I’ll mention in a bit, but I am definitely interested…

What’s to like? Well, the scaffolding support is rather nice. To be honest, though, it would be nice if someone would post a tutorial or howto that doesn’t involve building a TODO list. :) But I digress… For example, after creating the obligatory TODO mini-app, I decided to point rails at my wishlist database which has a PHP interface. It’s pretty cool to have a working UI after running a couple of code generation scripts, and I can certainly agree with Justin French’s excitement for creating a quick and functional prototype. When you toss in stuff like Action Mailer, a lot of the grunt work with building web applications goes away. I’m always in favor of removing the development that’s “just typing” so I can spend more time on the more interesting “conceptual” or “problem solving” stuff.

So why not switch? Well, I’m sure inertia has something do with it, as I have a lot of time invested in PHP. For example, I have my own set of code that acts like Active Record, which, when used with generous helpings of ADODB, makes the object/relationship mapping something I don’t have to think about. Then I have my own code generation scripts that use that model to create the controller (and, to a lesser extent, the view). It’s certainly not as polished as RoR, and as Justin points out in his post, there’s a good reason to go with a framework that is being actively developed by a large group of people rather than to continue using something that only has your contributions, but it works well and I’ve gotten comfortable with it.

Then there’s the system set up. If you’re using TextDrive (which looks cool, BTW), then this isn’t a concern for you, but I’m hosting myself and so am responsible for infrastructure issues. Right now, PHP has the advantage in this area. Of course I expect Ruby to catch up eventually, either with mod_ruby working better than it does now (turning off the security controls to run Rails just didn’t feel that good to me), or with FastCGI getting a bit better (FastCGI on Apache is OK, not great, but on IIS is no fun at all). Currently, though, it’s much easier to get PHP installed and running (with acceptable performance) than Rails.

Finally, there is youth. Rails is still in its infancy. While that’s a great opportunity for getting in there and being able to make contributions to the core product (I have more ideas than I do time), it’s not so great when you have to do deal with significant changes happening to your framework. This will settle down a bit soon, I’m sure, but at the moment I’m still a little hesitant to use something at version 0.11.1. :)

RoR is cool though, so I’ll continue to watch it and play with it. Ruby is a fun language, and if this framework continues as it has commenced, it will get harder and harder to resist. :)

Comments