views:

932

answers:

8

Before I asked this question I had a look through the search results for 'Ruby on Rails' here on SO. Couldn't find much, but the following (found on this page) amused me

Personally, I started using .html, moved onto php, tried ruby (hated it), discovered Python / DJango.. and have been happy ever since.

Now here's the deal. I have no personal intention of learning Ruby on Rails just yet, but it's the topic of a group presentation I am to do at the Uni (and my mates chose the RoR subject). People with a grudge against students asking homework-type questions should leave immediately.

This question is for RoR people who find it great. I hope to find those that claim RoR is the best (authors of the breathtaking testimonials to be found at RoR website). What makes RoR so outstanding? What would you like the youths of today to find out about it just before they leave the Uni with a degree. Try suggesting something that could root in their minds and perhaps navigate them the RoR way after leaving Uni.

Your answers will not only help my presentation, but could be the source of enlightenment for many.

+3  A: 

To name a few items:

  • Large developer community (not saying that python doesn't)
  • Convention over configuration rocks
  • Can be used with JRuby/Warbler to make rails run on Java Application servers. Very important when trying to drag Enterprise into the 21st century (Django can be used with Jython to work with application servers, but is less mature).
  • MVC framework helps keep your application structured.
  • Scaffolding and generators to get your project moving.

Rails doesn't try to be the only way to do web applications, that's not the intent. It fulfills a specific set of needs.

Vertis
+4  A: 

I blogged in detail about why I love Rails three years ago, but for me for number one cool feature is that it makes developing web applications easy and fun.

John Topley
I really like the blog. Started out with Delphi for the same reasons as I did. I still love it but use it less and less... thanks for the link
Peter Perháč
Thanks, glad you liked it!
John Topley
The Wicked Flea
+1  A: 

My main motivation for using Rails is ruby. I touched a lot of languages before I found ruby and I never felt I was any good in any of them. When I met ruby everything just made sense. It's a beautiful language; Easy to learn but hard to master.

I use rails because it suits my needs as a webdeveloper and is very feature rich.

Maran
I read John Topley's blog on why he loves Rails and have myself developed some sort of liking for it (although I never tried it). It's good to hear you, too, find it great. But anything in particular? Ruby language - easy to learn. Will add to my presentation. Any more motives for youths to try RoR?
Peter Perháč
It's a great language to learn oo-programming. I got some java and php during my study but I really got oo-programming when I made ruby/rails where everything was an object.Why Rails? Young and vibrant community, loads of plugin so you dont have to reinvent the wheel everytime, db-agnostic etc.
Maran
+3  A: 

This isn't a comparison against Python - it's a general list of things I like.

  • I write a lot less code than I would in Java
  • ... And the code I do right is very readable and maintainable
  • I very rarely need to think where some code lives or how to handle a common task - it just has its place (e.g. migrations are built in)
  • You don't end up using lot of different technologies on one project (Java, EJB, Hibernate, JSP, SQL DDL, Ant, XML, taglibs)
  • Interpreted rather than compiled saves you lots of development time
RichH
These are indeed some really nice points. Maybe should raise this as separate question, but won't. Just of my own curiosity, how long do you reckon would it take for a Delphi/Java/PHP/SQL experienced person to learn RoR?
Peter Perháč
It really depends on the person. I had a Java background and I was productive in a week and had a very good understanding in a couple of months. If you were starting from scratch, learning RoR would be much easier than JSP / Struts / Spring / Hibernate.
RichH
+1  A: 

Honestly, I like the design of Django more then rails, but I like ruby more then python. Its a personal thing, because I know plenty of people who feel the opposite way, but I find ruby to be one of the most elegant languages I have ever used.

Matt Briggs
+6  A: 
  • ActiveRecord's dynamic finders:

    Person.find_by_name_and_company_id('Jorge Luis Borges', 42)
    
  • rjs, writing javascript in ruby:

    page['element_id'].insert_html :bottom, :partial => 'comment'
    
  • ActiveRecord's scoping

    class Shirt < ActiveRecord::Base
      named_scope :red, :conditions => {:color => 'red'}
      named_scope :dry_clean_only, :joins => :washing_instructions, :conditions =>  ['washing_instructions.dry_clean_only = ?', true]
    end
    

calling Shirt.red will query the db with the "color = 'red'" condition the cool part, is that if you combine more than one scope eg:

      Shirt.red.dry_clean_only

it will build just one query, with all the conditions and joins necessary to satisfy both scopes.

  • ActiveRecord's Migrations, being able to manage db structure and data using active record, just like in the app's code, with minimal sql usage.
Maximiliano Guzman
+1 for ActiveRecord's scope feature and dymanic finders; but I disagree with rjs on the grounds that I don't use Scriptaculous.
The Wicked Flea
Prototype/Scriptaculous is not a requirement as I understand it. I believe jQuery is also supported for RJS using a plugin.
John Munsch
+2  A: 

One of the main reasons for me is that it puts fun back into web programming. Suddenly things become simple and within reach. you don't need months of code crunching and don't need tons of code written. you can do some pretty amazing things with just a few lines.

And it feels good :)

Vitaly Kushner
+3  A: 

Tools are about solving problems. It doesn't matter whether you're talking about the tools in a wood worker's shop or a programmer's. What impressed me about Rails (and still does) is that it was extracted from framework used to build real-world web apps and has repeatedly been improved by people who extended or changed it after using it to build real-world web apps. It was no mere academic exercise.

Some of the specific problems it addressed:

  • Getting started quickly. If you are looking to get a web application underway quickly, what better choices could you have than a framework that specifies an existing directory structure (one based on MVC), with lots of code generators, and choices already pre-made for you as to components like JavaScript library, testing support, ORM, etc. You may not agree with all the choices but you can assume them and have something that will work for 80% or more of projects and swap out something later if you have a preference.

  • Long term maintainability. Migrations give you ways to move data forward as your code changes, something that happens in any real-world application, yet most frameworks do not account for that at all. Separating all of the parts of your application into a directory hierarchy already setup with areas for testing, database, configuration, etc. again aids the long term maintenance of your project.

  • Reduced human error. Configuration files give you extra opportunities for human error. Logical conventions, once learned can avoid mistakes like the classic mistyped file name or class name in a configuration file error.

  • Recognition of different modes of development. Rails has built in support for the idea of having a different set of settings for development vs. test vs. production. Real apps have this too, but often the framework around them doesn't accommodate it and you end up having to swap configuration files in and out to achieve the same effect (see human error above).

  • Good practices. Several things I've mentioned above embrace and encourage good programming practices (MVC, standardized project layout, etc.) but Rails is often explicit in encouraging them and not just implicit. For evidence of that you need look no further than its built in support for test driven development.

John Munsch
wow, thanks for this post. +1
Peter Perháč