- in Coding
I'm currently working my way through Michael Hartl's magisterial Ruby on Rails Tutorial, RailsTutorial.org. The book is dense, challenging, and superlative. For those of you traveling just behind me on the learning curve, I have a few thoughts on how to most effectively approach the book and learn Ruby and Ruby on Rails.
Mirror What You See And Iterate
- First, skim ahead before you try to implement anything in a specific chapter. I found I would get confused and attempt to figure something out, only to later discover the exact explanation I was seeking was in the next paragraph of Hartl's book. More broadly, if you skim ahead and then circle back, you have a sense of where you are headed and the point of what you are implementing.
- Second, don't try to understand everything the first time you work through a chapter. There is a flow to how a rails app is built. "Controllers." "Views." "Routes.db." At first you don't recognize this flow and are swimming in a sea of confusion. As you continually mimic the moves that Hartl makes in the book, you start to see the matrix. If you over-index on the one piece you don't understand, you slow down the learning process. In fact, you may benefit if you look at the Rails Tutorial as something you are simply mirroring rather than understanding initially. Then, go back and work to grasp the context and syntax more deeply later.
- Iterate. Once you get that first Hello App (Chapter 1) into production, do it again. Ditto for the Toy App (Chapter 1), Sample App, (Chapter 3), etc.
- Don't lose heart when you get stuck. Figuring out what went wrong is when you actually learn the most in this tutorial. It forces you to slow down the "copy paste" cycle and understand what is going on and how the different parts of the application relate to one another.
Get Off Cloud9 ASAP
- Get off of cloud9 as quickly as possible. The c9 environment is helpful to allow you to dive into the tutorial immediately rather than spending several days stumbling through setting up Ruby and Rails on your computer. However, the c9 environment is compressed into one screen, and therefore the font is quite small. Also, I found cloud9 to have connectivity problems. I'd have to wait for them to fix their server (or other) issues to be able to login.
- I tried using the Oracle VM Ubuntu on my Windows machine, but found performance sluggish and super annoying. So I ended up dual booting Ubuntu onto my laptop. This worked out well. Once you get booted on your own machine, you can work more quickly. Plus, you can code offline. Here's the best tutorial I found to dual boot. (Even though it says Windows 7, it worked for me with Windows 10, and the troubleshooting section was key.) Be careful. Backup your Windows computer before you go down this route.
- Here's the best tutorial I found for actually installing Ruby and Rails on Ubuntu. (Note, when using this tutorial, be sure to change any version numbers for Ruby or Rails to those recommended in Chapter 1 of the Hartl book.)
Branch Out And Build Your Own Prototypes
- As soon as possible, try to branch out from the example apps in Hartl's book and build something you are interested in. You will immediately see where your knowledge gaps lie.
- Complete the first few chapters of RailsTutorial.org, then start learning Ruby concurrently. You have to know the underlying Ruby language to some degree at some point. If you just learn Rails, you will be hugely hobbled.
- The basics of elementary programming syntax are surprisingly limited in scope. There are a score or so key concepts (strings, loops, conditionals, objects, methods, etc.) that you need to learn. When you first dive in, you will have no clue what any of the syntax means. (It is exactly like going to a foreign country and encountering a new language; you are lost.) I suggest you start with a couple of short, charming books to get the big picture quickly: Chris Pine's Learn To Program and JumpstartLab's Ruby in 100 Minutes
- Next, work through a few other free tutorials at places like rubymonk.com and tryruby.org.
Watch Videos Of Others Coding in Ruby and Rails
- I recommend you watch some videos that show people coding in Ruby and setting up Rails apps. There is something demystifying when you watch someone setting up a rails app and writing code in Ruby. It's also gratifying to watch experts make the same mistakes you do ;). Here are the best videos I found for both Ruby and Rails.
Here Comes The Valley of Death
- Prepare for disillusionment. The Suck Phase is on the horizon, and you will have to journey through your own Valley of Death. It will eventually dawn on you that you are going to have to build a bunch of random stuff before you have the skills to build the web applications you actually what to build. This is because you need to develop your skills step by step. So be it. Just muscle through.
- Despite the point I just made immediately above, actually try to build stuff as soon as possible. You will hit a wall. (I'm there right now!) But that's the way it goes. Once you stop mimicking tutorials, you will realize you are still lost. That's the reality of passing through the Valley of Death.
Stay Focused, Minimize Self-Doubt, and Keep Going…
I'm sure there are lots of other tips I haven't discovered yet. So I welcome your suggestions.