How am I learning Ruby on Rails

Sharing makes learning fun: Share on FacebookTweet about this on TwitterShare on RedditShare on Google+Share on TumblrDigg thisPin on PinterestEmail this to someone

As a beginner in web programming, I had never worked on any web development framework. Though I had a basic understanding of Python modular programming (i.e. I knew for loops, if else statements, functions and methods), HTML and CSS, these did not alleviate me any pain in understanding how the Rails framework works. In this article, I’m trying to share with you the path I’m taking to learn Ruby on Rails.

 

1. Advice for Complete Programming Newbies

If you are a complete starter in programming, I will strongly suggest you to learn the basics of HTML and CSS before starting on the adventure of RoR. A great place to start may be Codecademy.

 

2. Learn Rails before Learning Ruby?

Hell no!

Many people are suggesting the newbies to learn Rails before learning Ruby (I can’t imagine how anyone will be able to do that). In fact, I had gotten this advice myself when I was a complete starter. And I went on to start reading about Rails, assuring myself that it was OK not to understand any of the Ruby code. I just ended up not learning anything.

Ruby has some key elements that are totally different from other languages. Rails is a framework that is built on Ruby, trying to understand any of the Rails stuff without a basic understanding of Ruby will just prove to be a disaster.

 

3. My Path in Learning Ruby & Rails

3.1 Ruby on Rails Tutorial (2nd Edition)

I started off by reading the book Ruby on Rails Tutorial (2nd Edition), by Michael Hartl. You can choose to buy from Amazon, or read online freely at Railstutorial.org.

Honestly, I do not like this book. This book goes through building a Rails app with you. But it shows too much Rails magic without explaining much about them. One of things about Rails framework is “Convention over configuration“. That means there are a lot actions in Rails that are not explicitly stated, they are done by conventions. For someone who has never had any experience in web programming frameworks, it is a real pain to try to work with all these magic.

Another thing that made my learning experience with this book painful was that I did not understand much Ruby code back then. Though the book has a few sub-chapters talking about Ruby, what I feel is that they are insufficient.

All I learnt from that book are RVM (Ruby Version Manager) and Heroku (used for Rails app deployment).

 

3.2 Programming Ruby 1.9 & 2.0: The Pragmatic Programmers’ Guide

After wasting some of my time on Rails Tutorial , I learnt from my mistake. I started on learning Ruby.

I spent 3 days reading through the first 10 chapters of the book, which gave me a really nice idea of the basics of Ruby.

 

3.3 Agile Web Development with Rails 4

This is a great book. I love it. Similar to Rails Tutorial, it too teaches by going through step by step building a Rails app, but it explains much more in detail.

I read through the first 8 chapters of the book, I then really started to gain some ideas of what is happening inside Rails. I really started to know the conventions/magic within Rails.

After that, for some tasks that were taught in the book, I tried to solve myself by finding online documentations and writing code before checking the correctness with what was actually written in the book.

If you are following this book, please note that there are hints and other people’s discussions about end-of-chapter exercises available at this link.

Working through the exercises and writing code myself have been extremely essential and helpful in my learning and understanding of Rails.

At the time of writing this post, I’ve read through the first 11 chapters of the book, and I feel that I have already gotten the basic ideas of Rails. Reading and learning from a book can get boring after some time. So I decided to move on to work on my own project.

 

3.4 Learn By Doing

I am currently trying to develop a Rails app making use of a RESTful API. Doing a project really helps in consolidating the knowledge I gained from reading all the books.

I always feel unsatisfied by just learning the methods or functions taught in the books. The skill of finding answers is much more important.

Here are some great resources:

Ruby Version Manager Documentation

Ruby Gems

Ruby Documentation

Ruby on Rails API

Ruby on Rails Guides

Sharing makes learning fun: Share on FacebookTweet about this on TwitterShare on RedditShare on Google+Share on TumblrDigg thisPin on PinterestEmail this to someone

4 comments

  1. Hi Peter,
    Thank you for sharing this, it provides a good structure for how to approach learning.
    I agree that ‘doing’ Rails first is not at all helpful.
    Best of luck.
    Jo

    1. My learning has been on and off. I spent around 3 weeks on the Rails Tutorial book. But I didn’t learn much from there. I then stayed off Rails for almost a year before picking it up again. And at the time of writing of the post, I spent a month on reading books and learning the basics of it. Then I went on to write my own project. Doing a project helps me learn a lot more than merely reading books. Hope this answers your question

Leave a Reply

Your email address will not be published.