How I TRAINed to learn Rails
A Guide to Learning Rails in 2 months
Although I learned a few programming languages in the past, I had absolutely no experience with them except for Visual Basic, which is barely considered a language. I learned rails the hard way: 18 hours every day for 2 months. No sleep, no partying just pure hard coding. I forbade myself to watch TV, movies or even youtube videos if it wasn’t related to coding. Everything I was doing or reading was for that only purpose: “Becoming a senior developer ASAP”. I was rusty and although I had played with Html/Css before, I felt that I needed to review everything. So I started by reviewing the basics (HTML5, CSS3) and playing with it. You’ll need these basic skills to learn rails.
NO! Don’t Learn Rails before Ruby
When you decide to learn a language there are always mistakes that you make and realize later on as you are getting more experienced. Knowing what those mistakes are can allow you to save a considerable amount of time.
When I first decided to learn Ruby on Rails. I read a few articles by different bloggers that were saying that you don’t need Ruby to learn Rails. I now totally disagree with them! Take it from someone who initially took that path. I realized a bit later what was wrong with that approach. The first sentence about rails on wikipedia says “Ruby on Rails, often simply Rails, is an open source web application framework which runs on the Ruby programming language”. This simple sentence explains why knowing ruby will become a key factor in mastering rails: The code you type on the Rails framework is Ruby. The only difference is that the system of that framework is arranged in a way that makes it more organized and convenient for you to build applications.
If you take the time to fully understand Ruby before you learn Rails; then learning Rails will become a piece of cake. Whether you build controller, action or else, it will all come down to Ruby. Understanding ruby will also allow you to be more agile with rails and being able to go directly to the source to understand any methods or class. The greatest assets you’ll get once you’ll learn Ruby before Rails is understanding gems or the ruby and rails documentation better.
What Didn’t Help?
I read a lot of books in a short period of time, watched hours of tutorials and courses but not everything was helpful. Some of the thing I learned actually confused me more than I already was. I broke down a list for you.
- Blogs can confuse you
Unless you are reading a blog post such as “How to learn rails”. As a newbie, blogs that teach you rails won’t help but confuse you. There is one simple reason for that: Ruby/Rails have different practices depending the versions. For instance; the asset pipeline was introduced in Rails 3 and a lot of blogs won’t tell you that but assume that you already know.
- Ruby and Rails Versions
Ruby is a growing language and there are hardworking people that are still improving it. Same thing with Rails. As the language and framework improve; a few things will change. For someone that have absolutely no experience with ruby/rails noticing a change is like looking for a needle on the grass. A good thing to avoid confusion between ruby or rails version is to first figure out what’s the difference between them. Read the release notes; they contain usefull information that will avoid you hours of debugging. To give you an idea of how the release notes look like: Here a link to the release note for Rails 4.
- Asking Question About Everything on IRC
I’ve been using IRC for 14 years and until I decided to learn Rails it was always one of my favorite spot to learn. But people on the ruby/rails channel were very impatient and rude. I think they’ve forgotten something as important as “how it feel to be a newbie”. People on IRC were rude but they weren’t stupid and some of them gave me the best advices that put me on my way to learn Rails “Everything you need to learn are in books”, “Figure things out on your own! You’ll become a better problem solver”, “Don’t expect people to build the code for you, figure it out on your own” and my favorite one “Google!”. IRC is only usefull when you face some really obscur bug.
What Was Useful?
- Reading Books* over Blogs.
This was by far the best introduction to Ruby. When I read Chris Pine book I had already read other tutorial on the web and read a few books but it made me realized that this was The Book I was looking for when I decided to learn Ruby on Rails. Chris Pine has a great way to explain the general concept of Ruby and put you in the mindset of a ruby developer. Available for Free.
People have different ways to learn; personally I love challenges. Going through this book forced me to face problem and find ways to solve them. It also gave me a good grasp and practice of the ruby language. I went through every single chapter and exercice in about 2weeks and when I was done I felt that I had a good understanding of Ruby.
The Rails Way by Obie Fernandez ( Get this Book )
Anything by Obie Fernandez is great. He is an amazing developer that writes great learning books.
Most people in the community always recommend to start with this book; I would never recommend this book to someone that is just starting to learn rails. Do the rails tutorial after you’ve read basic books about rails and once you’re familiar with ruby. This book is available for Free. The great thing about this tutorial is that it teaches you multiple skills in one: Git, CSS, HTML and Rails.
- Interactive Courses
Rubymonk introduced me to Metaprograming and helped me getting familiar with some of the most common ruby methods. It’s a great source to improve your understanding of Ruby before moving to Rails.
Codeschool can be difficult to understand if you don’t have some basis, this is why I always recommend codeschool to people that have already started reading about ruby or rails. What I love about code school is their approach of “learning by doing”. They have really good instructors. When you will watch and do the different codeschool video. Make sure that you download the PDF of each course and use the PDF while you’re doing the homework. Codeschool is not free but most of their lesson 1 episode 1 tutorial are free. The cost of a member ship is about $25/mo.
I started following various skills on coderwall and read posts by people from the community and I started learning little tricks like the pluck method in ruby and else. Some developers will have better ways to do certain things, it’s always good to be curious and eager to improve what you already know. In the end good code comes from better refactoring.
I am now proud to say that I’ve watched almost every single episode on Railscast. When I was learning Rails, I built at least 35 differents apps that were using various gems. Railscast was the best place for me to get familiar with those gems and to learn how to use them quickly. Railscast also teaches me little thing that became extremelly useful overall. Always read the comments, people will add explanation or question that will allow you to broaden your view on each course.
- Blogs :)
Blogs don’t help if you’re just a newbie, but once you start to grasp a better understanding of Ruby or Rails. Blog start to be useful. Especially when it comes to resolve bugs or grow your knowledge of rails. You will find articles that will give you the skills you need for better practices, tricks or tips.
- Not Copying/Pasting Code
Even today I still type code line per line. It helps you to remember codes and it’s a good practice to have when learning a new language. Typing every single line of code you read has a tremendous effect on your memory. Just do it, You will remember.
- Not getting tired of Google-ing
One skill that every developer need to master is “Googling”. Whenever you find a bug or you are blocked building something: Google like it’s a present tense. Never get tired of Googling. The web is vast enough and the chances are that you will find something outhere that could solve your issue. One of my favorite website I always stumble uppon while googling is Stackoverflow but I often always ended up on Google Groups and Forum or Blogs. There will always be things that you can’t remember or that you would like to verify or double check and it will all come to your googling skills. The faster you’ll be able to find something on google or stackoverflow, the faster you will be able to resolve issues you’ve never seen before that other people have already experienced.
- Reading Documentation and Source Codes
If you are stuck and nothing online can resolve your issue: Go back to reading, because the chances are that there must be something that you didn’t quite understand. When that happen it’s a good time for you to go to the source code and explore how things works. Reading the Rails Source Code is extremely usefull. It allows you to learn how the entire system work.
The Ruby on Rails Guide is underated. Most people skim it and to be honest, the first time I read it I actually skimmed it too. Never skim the rails guide, read it in it’s entire form.Always come back to the Rails guide and never assume that you’ve mastered rails enough to avoid it. Coming back to the rails guide doesn’t mean that you’re stupid. It smart to go back to the source to better understand something. Read as long as it takes but try to grasp the concepts that confuses you.
Last but not Least
I used to take the transit every morning to go to work and in the subway or the bus I would read the Ruby Doc. Just randomly reading about random methods and classes. This little practice became really powerful when I would go back to my computer and start coding. Also If you don’t know how to use the Terminal or Prompt, I would suggest that you get familiar with it. You’ll need it when you will install ruby, rails, rvm, homebrew, or even deal with environment issue locally and on your server.
This article had now more than +100K views and thousands of recommendations. It was also recommended by the Founder of Ruby himself. wow. I am glad to see that my article reached so many people. Thank you for all the emails and kind words.
If you like this post it would mean a lot to me if you hit the “recommend” button below.
Feel free to send me a tweet: @Richardsondx
Related Article: How to land your first Ruby on Rails job.
Related Article: Why Googling is the most important skill a developer *must* have.
Visit my Landing Page: