Ruby on Rails vs LAMP?
October 31, 2006 1:58 PM   Subscribe

Why should I look at Ruby on Rails for development of applications instead of the traditional LAMP stack, especially given the advancements in PHP since 5.0?

I realize this is a bit open-ended, but I'm very curious in the advantages of Rails. The only thing I can seem to glean is that defining your business objects also defines and creates their dependent database objects.

So I guess I'm also asking: is Ruby on Rails > PHP?
posted by xmutex to Computers & Internet (12 answers total) 6 users marked this as a favorite
 
RoR's big claim is in rapid development-- from concept to working page in under 30 minutes or your money back. That kind of thing.

It's another language and another way of writing web applications. FWIW, I'm still using Perl, and I make great web apps with it.

Personally, I don't think it's a question of RoR > PHP. It's more like a statement: PHP != RoR != Perl. But they can all do similar things.
posted by mcstayinskool at 2:11 PM on October 31, 2006


Moreover, there are benefits to Ruby that have nothing to do with Rails, and vice versa.
posted by jjg at 2:13 PM on October 31, 2006


Rails forces you to follow a Model-View-Control system, in a standardized way. It's not a language but a framework, which makes your comparison to PHP a bit hard to make. You could compare PHP to Ruby but people aren't using Ruby on Rails because of the Ruby part.

I presume there is some PHP framework that does the same kind of thing? That would be a better comparison.
posted by smackfu at 2:16 PM on October 31, 2006


In one of my jobs I run the servers for a rails app. It's not insubstantial, >12k LOC.

My experience is only with this one app. I have had problems getting RoR to run in a big, enterprise environment. It's all very young, and the infrastructure pieces aren't all there yet. Also, it changes quickly, so if your developer is on edge rails and you're not, something is going to break.

And I've had plenty of things break. Some of it could be the developers. Most of it, actually. And I've played with RoR, it's very easy to develop a basic app. From the coding side, I can see why one would like it. From the sysadmin side, it's just much less tested.
posted by These Premises Are Alarmed at 2:24 PM on October 31, 2006


PHP framework: http://www.cakephp.org/
posted by nonmyopicdave at 2:25 PM on October 31, 2006


People are using ruby on rails because of the ruby part (at least partially). While not perfect, ruby is a FAR more elegant and concise language than PHP.

That said, rails also has many advantages - migrations, integrated testing and deployment, and rjs, among other things.
posted by Caviar at 2:26 PM on October 31, 2006


It's not quite fair to compare Rails to PHP; Rails is a framework (and one I like a lot, compared to others I've used) built in Ruby. Your question might be better put as: Rails > Django? or Ruby > PHP? or Python > Perl? (On preview: or Rails > Cake? which I have worked with, and it's a tidy PHP framework that suffers for comparing itself to Rails.)

I've been writing commerce-level PHP for many years now, and Ruby and RoR for maybe a little over a year, and my own opinion is that Ruby just feels more elegant. As a language, the syntax seems to be closer to the way I conceptualize logic and OO stuff.

I'm not as fluent in Ruby, but when I figure out something I can compare with a similar PHP structure, I am frequently pleased with how easy it is in Ruby. Often it is a simpler solution, and one that somehow seems more natural to me.

If you're curious, find a Ruby primer, not a Rails tutorial. It's a much better introduction to the true difference between PHP and RoR. And you'll get a feel for the language without having to worry about framework-specific stuff.
posted by sonofslim at 2:41 PM on October 31, 2006


I used rails this last summer to write a bunch of internal applications where I work. They were fairly simple and database driven, but the big thing that rails gave me was that I had the initial version up and running in just a few days (including learning the language).

Once they were up, I had the standard deluge of feature requests, and rails allowed me to just knock them out. Simple refactoring kept the code clean.

The biggest thing I like is that the controllers and models where most the work happens have no html in them. That's very nice for readability when the business code is all one language. The views are a templated html thingy, and it's fairly clean for what it does.

I recommend the Agile Web Development with Ruby on Rails book if you are willing to buy a book. The first half walks you through the parts of a rails app, and makes everything very clear.
posted by cschneid at 2:58 PM on October 31, 2006


I've had a lot of fun using Code Igniter. It's a rapid development MVC framework for PHP. It's much much better than cakephp, in my opinion.
posted by null terminated at 3:21 PM on October 31, 2006


One other thing that might be useful in understanding the language/framework comparisons is that Ruby, while moderately popular since its inception, has really taken off since the introduction of the Rails framework. Conversely, more established languages like Perl and PHP have a number of popular frameworks, as well as endless applications created from homebrew frameworks or as ad-hoc collections of functionality.

As a consequence, it's pretty difficult to cleanly compare the ecosystem around the various platforms. In addition, the newer scripting languages (Perl is older than PHP, which is older than RoR) are more closely tailored for use in common scenarios encountered when building web apps.

The reason to look at Ruby on Rails is because knowing more languages, being familiar with more frameworks, and understanding more development methodologies will make you a better developer regardless of which platform is ultimately the right one for your app.
posted by anildash at 3:53 PM on October 31, 2006


I've had experience with web development in Java , PHP, and Ruby (via Rails). Rails is by far the most fun and most productive environment I've worked in. Ruby really is a fantastic language.

The proof is really in the pudding, so try ruby now in your browser - its a free, in browser tutorial. Should take 30 mins to an hour for the whole thing.

If you like what you see, I have a book list (self link) I keep updated on regularly, and I would second the recommendation for the Agile book - make sure to get the 2nd edition, as its tracking the latest Rails version via beta pdfs and should be in print in a few weeks. Ruby for Rails is also a great book, with a larger focus on Ruby first compared to the Agile book.
posted by rsanheim at 9:43 PM on October 31, 2006


If you want to steer clear of installation hassles and using a command line, Code Igniter's a good option for PHP that gives you some of the benefits of RoR/Django but with an easy step up from 'hackier' techniques.

(To me, Django seems better thought-out than the hype-laden RoR, but I've not used either enough for that to be a robust opinion)
posted by malevolent at 1:22 AM on November 1, 2006


« Older Korn gossip from the 9:30 Club   |   Corkboard Alternative? Newer »
This thread is closed to new comments.