Learning Ruby and Rails in 2014

In the last few weeks, I have been approached by a couple of people who are interested in learning Ruby and/or Ruby on Rails. And for their sake, and for my own interest, I investigated what are the best resources at the moment. Ruby and Rails ecosystem is a one that evolves really fast, and while I like it a lot, because we have new toys to play with all of the time, it is not a great thing for new developers. Also Rails has grown to this big behemoth, and although I like Rails a lot, and will continue using it as long as I can, I’m not sure it is newbie friendly. But I’ll address that one later.

Before i list the resources, and their brief descriptions, there are a couple of rules you should follow, to have an easy ride with Ruby on rails. A basic understanding of HTML/CSS is needed, because, you are learning a web framework, which incidentally runs in the browser, which incidentally uses HTML/CSS to render the pages. I’m not telling you that you need to be a frontend developer/designer, just to have a basic knowledge of it. Ok, no more philosophy from now on. You should also be acquainted with JavaScript, not that you need to be an expert in it, but just have a basic knowledge of it. You are going to use it if you want to have any dynamic interactions in your web applications, but it is not as crucial as HTML/CSS. After you have your prerequisites in order (and it will probably take you a couple of days to get acquainted with HTML/CSS and JavaScript), you can start learning a new programming language, and a web framework. The basics will come in handy if decide to use any other programming language and framework, if your goal is to create web applications.

Learning Ruby on Rails is mostly done backwards, at least that is the way I’ve done it myself. I first “learned” Ruby on Rails, then started learning Ruby, because it was pretty stupid not being skilled in a language that runs your favorite web framework. Who would of thought that by learning the language, you get to understand the framework better. You should not be a fool that I was, and learn the language first. Also, learning Ruby on Rails is a really big bite to chew all at once. Here is a brief overview of the things you are expected to learn all at once:

  • A new language
  • A whole web framework and its abstractions
  • HTML/CSS (if you haven’t done web development before)
  • JavaScript (or CoffeeScript and its abstractions)
  • Probably much more stuff that I don’t remember anymore

Learning Ruby

First thing you want to know is how Ruby syntax looks like, and how it behaves. I think that the best possible way to find out is to Try Ruby. This is a great interactive tutorial, which helps you to learn the language basics. There is also one more site, which I’ve been using lately, to get an insight into other programming languages: Learn X in Y minutes and specifically their Ruby tutorial. After you have done the ruby tutorials, and at least grasped the language basics, you will be able to decide if you like it or not. If you chose not to experience the awesomeness of Ruby, and everything that comes with it, that is OK. To each their own. If you want to continue learning ruby, this is probably the best book there is: Programming Ruby or colloquially called “The Pickaxe book”, from which you will not only learn about the Ruby programming language, but there are also three Regex chapters from which you can learn to be a wizard.

Learning Ruby web frameworks

After you have learned Ruby, the next step on your itinerary is learning Ruby on Rails. I would like you to make a short break here, and learn something a bit closer to the metal. Sinatra is a great small Ruby web framework which will teach you how to build small and simple sites or API endpoints. Also, it is possible to mount Sinatra apps in Rails, and the Rails learning curve will be easier for you if you already know Sinatra. And maybe you decide that Sinatra, with some added libraries is enough for your project. So as a next step, I want you to look into Padrino which is built upon Sinatra, and it also gives you a predefined way to build your web applications.

Learning Ruby on Rails

Learning Ruby on Rails is a big task, and if you set out to do it, it can take you 15 minutes to build a blog, and probably half a decade to master everything that Rails can (and will be able to) do. In my opinion, the best resource to get you on the way is The Ruby on Rails Tutorial by Michael Hartl. A book (and videos) that have helped mold plenty of Ruby on Rails developers. There is also a free online version, if you are on a budget. There is of course the official Ruby on Rails Guides, and one of my favorite books on Rails, The Rails 4 Way which is a great resource, and each time I get through it, I find another new thing I should be using. There is (was) a great screencast resource packaged in Railscasts. Although it isn’t updated anymore (I really hope Ryan gets back soon), it is still a great asset for solving most of the specific problems you will encounter as a Rails developer.

I have focused mostly on free resources, although some of the books I recommend come with a price tag attached. The price, although it might seem a lot to you, is really reasonable, and is much lower than the value these books provide. Even if you don’t stick with Ruby, owning The Pickaxe Book, and going through the first part of it, will teach you some stuff you can probably employ in your language of choice.

I however, chose Ruby, and I’m happy with it. And it doesn’t mean I am, or will only be doing Ruby for the rest of my life (I probably could, if you don’t count JavaScript), but that Ruby on Rails solves the database backed web application problem in the best way I can imagine. And if that isn’t your game, you probably didn’t get to this part of the post. If you have, please try Ruby, it is a beautiful programming language that was designed to make developers happy.

Leave a Reply

Your email address will not be published. Required fields are marked *