简体   繁体   中英

Why should I use Ruby on Rails?

A friend of mine asked me if I was aware of Ruby on Rails ... and frankly I have heard a lot about it but know practically nothing about it. Any help will be much appreciated.

Ruby on Rails is a framework for building web applications. If favors convention over configuration which means that a lot of choices have sensible defaults and thus you can get something running with very little effort.

More info here: http://rubyonrails.org/

In addition to the default script/generators (which make scaffolds, models, controllers, etc for you), Ruby on Rails has a lot of convenient plugins that can handle the majority of the work for you, as well as a plethora of tools for tracking down bugs, errors, and bottlenecks in your code. I've outlined some examples below.

Convenient Plugins

  • Subdomain-fu allows you to set up and use subdomains in literally minutes
  • Active Scaffold sets up beautiful default "admin" pages that interface with the database
  • RestfulAuth is a basic, easy to use authentication system

Code Testing

  • RSpec lets you write clear, meaningful tests, and colour-codes the output
  • Cucumber lets you write even clearer tests
  • Metric-fu tests your code duplication, complexity, and more

There's also a lot of video tutorials for Ruby on Rails ( Railscasts ).

Why use it? Just to try something new. Ruby has changed many way I've programmed before and now it's my favourite language. Rails have combined all good practices and shown people now friendly framework may be.

Spending two weeks for studying Ruby + RoR is worth it, really.

I recently wrote a blog post about this and it covers some of the pros and cons of using rails for building web applications (disclaimer: I run a rails consultancy, but I tried to be as impartial as possible):

http://blog.bitzesty.com/what-is-ruby-on-rails-and-why-should-i-use-it

Why use it? Because you want to develop dynamic database-oriented web applications.

If you want to develop something else, Rails can become really annoying, although some of the components that ship with it (ActiveRecord, for example) can be useful on their own.

If the question was really supposed to be "Why use Rails over some other web app framework?" then there's plenty to read already on SO:

for example...

FWIW - An interesting perspective can be gained by looking at where Ruby ranks relative to other common languages in terms of popularity (a subject measure at best): TIOBE Programming Community Index . I wouldn't read too much into this, but it does provide some perspective.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM