Right Time for Rails?
But maybe it all comes down to timing. "Ruby on Rails had the good fortune to get the timing right," Hansson says. "There's enough awareness and sympathy for the agile methodologies we're aligning our philosophy with. Enough cheap CPU cycles available to make performance a nonissue for most applications. Enough understanding of what can be generalized in web development. And finally, there's enough people sick and tired of their existing development environments to look beyond the corporate dictates and explore greener fields."
Of course, this is the developer of Rails building the buzz for his baby, but effective marketing is one of the things Rails has going for it. Rails expert Chad Fowler says, "Marketing really is an important part, not just of what's driving interest in Rails, but of the Rails culture. For years, the geek culture has been extremely suspicious of anything related to marketing. They're starting to see, through Rails and other successes, that if you really believe in a technology and you want to see others succeed while using it, you need to market it. If nobody knows about it, nobody's going to use it."
A good place to investigate the power and simplicity of Rails is in the way it interfaces with your database. Rails implements the Model component of your MVC application via the ActiveRecord class (see Martin Fowler's Patterns of Enterprise Application Architecture, Addison-Wesley 2002, for a discussion of ActiveRecord). ActiveRecord wraps database records, encapsulates database access, and adds logic pertinent to the data. When you build your first Rails app, it's really surprising to see how, through the magic of reflection and Convention over Configuration, Rails is able to free you of most of the effort of integrating your database into all phases of your application. This line of Ruby:
class Person < ActiveRecord::Base; end
"is all the code you need," Fowler explains, "to have a full functional Object-Relational Mapping to a database table called 'people.' It just works."
But wait, there's more.
This is merely an overview of the Ruby on Rails phenomenon. DDJ will be tracking Rails closely in the coming months because it may represent a historic tipping point in development environments. Here are some places to go to learn more about Rails:
Books and articles. Dave Thomas at the Pragmatic Bookshelf seems to have signed most of the Ruby and Rails authors, including Chad Fowler (Rails Recipes) and David Hansson (Agile Web Development with Rails). But O'Reilly & Associates has Bruce Tate working on Ruby on Rails: Up and Running, Apress will be coming out with Beginning Ruby on Rails, and there should be several other Rails books released in the coming months. There are a number of books out on Ruby, and Pragmatic's Programming Ruby is readable online (www.rubycentral.com/book). The official Rails web site (www.rubyonrails.org) has links to a number of useful how-to articles, such as "Using Rails for web dev on Mac OS X" at Apple's Developer Connection, the starting point for Mac-based Rails development.
Blogs, web sites, and lists. In addition to the links already mentioned, see www.loudthinking.com and www.chadfowler.com (Hansson and Fowler's blogs) for links to more Rails info. Digital Media Minute has the "Top 12 Ruby on Rails Tutorials" (www.digitalmediaminute.com/article/ 1816/top-ruby-on-rails-tutorials). The Rails Wiki (wiki.rubyonrails.com) has documentation, discussion, and advice on Rails-friendly web hosting. Two starting points for Ruby information are groups.google.com/group/comp.lang.ruby and www.ruby-lang.org.