Blog

The Trail to Rails


Week 8


What is Ruby on Rails?


November 7, 2014


Everyone in my Dev Bootcamp cohort is excited to become a real, bona fide Ruby on Rails developer. And while we’ve been working long bleary-eyed hours during Phase 0 to get the basics of Ruby down, we haven’t touched Rails yet. Taking a step back, how many of us really know what Rails is? We may understand that Rails is the framework for many apps programmed with Ruby. But digging deeper reveals there is a lot more to Rails that will make our lives much easier in the near future as we develop our first apps.


Rails is full-stack add-on to the Ruby language that can be installed to give your programs a framework. Essentially, that framework saves you from having to write out a lot of the normal architecture that is needed with most web apps. Instead, you are able to focus on the unique pieces of code that make your app what it is. In this way, Rails reduces the amount of boilerplate code that is repeated over and over, enables much faster development, and allows the flexibility to be agile and adapt. For these reasons, many popular web apps including Twitter and parts of Amazon and eBay are written with Rails.



Agility and adaptability is one of the main benefits that Rails developers tout. Programmers often don’t know the entirety of how their final project will look when they first start out. Instead, they learn about the program’s functionality and add features as they go along. Without Rails, making these changes along the way would require re-writing the code’s “scaffolding,” or framework. With Rails, the “scaffolding” can remain untouched, making a much more agile, adaptable program. In this way, it’s also easier to get new engineers up to speed on a project they’re brought in to – if they know Rails, they don’t have to learn the program’s unique framework before they can start working.


Rails operates with a few basic principles built into it. The first is the principle of “convention over configuration.” This means that there are implicit behaviors defined by the Rails framework that you don’t have to specify. For example, database tables are automatically mapped to objects that share the same name, so you don’t have to write the code to link them together unless you give them unconventional names. Secondly, the “don’t repeat yourself” principle is very important to Rails. For example, manual testing can be very repetitive, but Rails has automated testing to save time and effort. In fact, Rails lends itself well to test driven development, allowing developers to write their tests first and develop according to the needs specified in tests.


Essentially, these principles mean that Ruby on Rails, more than other languages, has a “right” way to do things effectively. Rather than having many ways to “force” something to work, like in other languages, Ruby on Rails has a clearly defined way to accomplish things. Because of this, Ruby on Rails is more scalable, readable, and easily understood, since it doesn’t rely on conventions invented by each individual programmer but instead on programming “best practices.”