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?
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
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.
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.
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: