Saturday, September 22, 2007

rails and php




A very interesting blog post about switching back to PHP from Rails, yes, you heard right, PHP instead of Rails. He has some really good points, and I think you'll start seeing people moving away from Rails for big, complex applications.

For small, quick to launch applications, Rails really rocks. As you get larger and larger applications, you start running into impedance mismatches between the way that you think about your application and the assumptions that Rails makes.

With the current project I'm doing, a rewrite of sunshineorganics.ca in Rails, I'm still at the point where Rails is going to work well, but the last month has been pretty difficult, trying to figure out how to convert my mental model of how the application should work into how Rails wants to do things.

The biggest problem, by far, is the really pitiful state of documentation for anything slightly "out there" in Rails. For simple things in Rails there is just tons of documentation and code samples, but for things that are even slightly pushing the boundaries, documentation and discussion on the Rails mailing list just isn't there.

It's really strange, and I don't really understand why. In all the other programming languages and projects that I've worked on before, it has been much easier to figure out what I want to do.

I think that a big part of the problem is that Rails developers are way too entranced by doing magic things with Ruby, doing things with little magic solutions that sure look cool, but if you aren't totally immersed in the Rails culture are hard to immediately grok.

Another part of the problem is that Rails developers really like the latest "cool" solution, three years ago, Rails had all this ActiveWebService support, and then DHH got all anti on web services, and everything is all REST now. Well, there are major issues with REST, the biggest one is that GET, POST, PUT and DELETE are just not enough verbs to support many kinds of applications. They're fine for a certain subset of applications, but just don't have enough diversity for many applications.

Imagine English with just four verbs. The verb is the active center of a sentence, you hang nouns off of your central verb, and a language with four verbs is just not going to be very expressive.

I'm not sure what the solution is. I love Ruby, I love lots of things about Rails, but I think the whole Rails culture needs a reboot.