Rails vs PHP: Fair Comparison?

Posted by Lance Ivy Wed, 14 Nov 2007 03:19:00 GMT

“You can’t compare Rails and PHP, because one is a framework and the other is a language.”

Ok, sure. Let’s assume that what makes Rails a framework is that it tells you how to structure a project. Yes, Rails is a framework (it has structure) and PHP is a language (egads, it has no structure!).

We can still compare them.

For starters, because you can do web development in PHP as much as you can in Rails. It damages the wrists and the psyche, yes, but you can do it. PHP supports sessions, cookies, parameters, and HTML generation. It gleefully mixes all that support in with the core language, for better and worse.

But more to the point, you can still compare them because within the context of web development it’s not useful to compare Ruby vs PHP but it is useful to compare Rails vs PHP. How? By comparing one vs many in a single stroke. When someone compares Rails and PHP, I think what they’re really doing is comparing Rails against anything that could come out of PHP.

Rubyfied, the comparison expands like this:

PHP::Frameworks.any? {|framework| framework >= Ruby::Frameworks::Rails}
=> false

Is that really fair? Isn’t there a lot of detail lost making that kind of broad sweeping comparison. Yes! But is anything relevant lost? That’s a much harder argument. Go ahead and try, I’ll listen, but when it comes right down to it I’m prepared to short-circuit any such argument with one claim:

Anything built on PHP will have to fight that taint. It’s just not worth the effort anymore.

Posted in  | Tags ,  | 2 comments

Comments

  1. Greg Pederson said about 19 hours later:

    Nice write up. And I agree my original question was meant to understand the comparisons of a site built with PHP vs a site with Ruby on Rails….

  2. Richard White said 10 days later:

    @Greg: One costs more money and one costs more time :)

(leave url/email »)

   Comment Markup Help Preview comment