...

Tech 101: Ruby on Rails

tech-101-ruby-on-rails
Get Our FREE Guide to Landing a Junior Developer Job

Get Our FREE Guide to Landing a Junior Developer Job

Find out EXACTLY what you need to do to land your first full-time job as a web developer.

As you’ve been digging in to tech and tech terms, you may have come across the name “Ruby on Rails.” You might have also thought “WTH?”—it’s not exactly an intuitively understandable title. No, Ruby on Rails (or Rails, for short) has nothing to do with someone named Ruby careening around on a go kart track. It’s actually a framework for building web applications—which is nice to know, but what does that even mean?

Web applications (the things Rails helps to build) are easy enough to explain and understand: they’re computer programs that are accessed and interacted with over the Internet using a web browser on your computer, smartphone, or tablet (think services you use like Google Docs, Netflix, and Facebook). These apps are built with programming languages, and that’s where frameworks come in. A web application framework is a collection of tools based around a specific programming language that gives you models and templates for building web applications. By using a framework, you aren’t starting from scratch and reinventing the wheel each time you work on a new project—instead, you have a foundation to build from, with shortcuts and automation for basic, routine coding tasks. Ruby on Rails is then a framework for the Ruby programming language.

Let’s back up a bit: Yes, Ruby (without the Rails part) is its own programming language, created in 1995 by Yukihiro Matsumoto with the aim of designing a language that was “human friendly.” Let’s say you want to write code to make the letters “ha” print three times on your screen (“hahaha”). In some programming languages you might have to get there like this:

($i = 0; $i < 3; $i++) {

echo “ha”;

}

Not exactly warm and fuzzy, right?

Matsumoto envisioned a programming language that people could feel comfortable reading and interacting with, minus all the impenetrable-looking punctuation. And so, printing “hahaha” in Ruby looks like this:

3.times do

print “ha”

end

As you can see, the Ruby approach is a lot more intuitive and human, which has made Ruby a popular language in the years since its inception—Scribd, YellowPages.com, Hulu, and Twitter are all examples of sites/applications that have been written with Ruby. On its own though, Ruby can be almost so versatile and open-ended that it’s hard to focus its powers—and that’s where Rails comes in.  

Think of the Rails framework as a virtual scaffold attached to the Ruby structure you’re building, allowing you to easily rearrange things and move them up and down without having to lug everything individually up the stairs from the ground floor. For instance, websites and applications commonly rely on clicking links. Out of the box, the Ruby language doesn’t understand what a link is, and so each time you want to create an individual link using Ruby (without Rails), you’ll need to type out dozens of lines of code. With the shortcuts built into the Rails framework, you can bypass this busy work and simply type:

link_to(“Visit Skillcrush”, “http://www.skillcrush.com”)

This creates a link to skillcrush.com in the text “Visit Skillcrush,” pretty standard stuff when coding a website or app, and something that’s much better handled with a single, succinct line than a whole wall of code.

Because of the way Rails streamlines Ruby specifically for web work, learning to use Rails is a powerful skill to add to your overall versatility as a web developer. In fact, specializing in Rails can be its own lucrative niche, with plenty of listings for Rails-specific developer jobs. Rails also has a thriving user community, with groups like Rails Girls and RailsBridge offering resources and meetups for sharing Rails knowledge.  

So now you know! Ruby on Rails is a library of tools and coding shortcuts that makes the powerful and fun Ruby programming language more compatible with web applications. Hopefully now you’re fully equipped to dive into the wild world of web development with this super useful tool.

Get Our FREE Guide to Landing a Junior Developer Job

Get Our FREE Guide to Landing a Junior Developer Job

Find out EXACTLY what you need to do to land your first full-time job as a web developer.

Discover more from WIREDGORILLA

Subscribe now to keep reading and get access to the full archive.

Continue reading