27.02.2013 Views

Rails%203%20In%20Action

Rails%203%20In%20Action

Rails%203%20In%20Action

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

541<br />

appendix A<br />

Why Rails?<br />

A common question in the Ruby on Rails community from newcomers is, “Why<br />

Ruby?” or “Why Rails?” In this appendix, this question will be answered with a couple<br />

of key points about why people should be using Ruby on Rails over other frameworks,<br />

covering such things as the culture and community standards.<br />

Ruby is an exceptionally powerful language that can be used for short scripts up<br />

to full-featured web applications, such as those built with Ruby on Rails. Its clean<br />

syntax and its focus on making programmers happy are two of the many major<br />

points that have generated a large community of people who use it. There are hobbyists<br />

who use it just for the sake of it right up to hardcore people who swear by it.<br />

However, Ruby (and by extension, Rails) should not be used as “golden hammers”.<br />

Not all problems are solvable by Ruby or Rails, but the chance of running into one<br />

of these situations is extremely low. People who have used other languages before<br />

they have come to Ruby suggest that “Ruby just makes more sense.” 1<br />

The speed at which that you can develop applications using Ruby on Rails is<br />

demonstrably faster than other languages. An application that has taken four<br />

months to build in Java could be done in three weeks in Rails, for example. This<br />

has been proven again and again. Rails even claims up front on http://<br />

rubyonrails.org that “Ruby on Rails is optimized for programmer happiness and<br />

sustainable productivity.”<br />

The Ruby and Rails communities have a consistent focus on self-improvement.<br />

Over the last couple of years we’ve seen developments such as the improvements<br />

from Rails 2 to Rails 3, Passenger (covered in chapter 14), and Bundler. All of these<br />

have vastly improved the ease of development that comes naturally to Ruby. Other<br />

developments have focused on other areas, such as the RSpec, Capybara, and<br />

Cucumber 2 gems (featured prominently in this book), which focus on making testing<br />

exceptionally easier for Ruby developers. By consistently improving, things are<br />

becoming easier and easier for Ruby developers every year.<br />

Along the same vein of self-improvement is an almost zealot-like focus on testing,<br />

which is code that tests other code. Although this may seem silly to begin with,<br />

1 Quote attributed to Sam Shaw from Railsconf 2011.<br />

2 A quick nod to the aruba gem: http://github.com/aslakhellesoy/aruba, which is used extensively to test<br />

RSpec’s and Cucumber’s command-line interfaces (CLI), but can also be used to test other CLIs.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!