[LRUG] Beginning Rails in 2012
jameshiggs at gmail.com
Fri Mar 16 02:40:38 PDT 2012
(I tried to post this last night but failed. I sent it to Tom off-list, but I thought it worth posting here anyway in case others might find it useful or have further suggestions)
I was in exactly this situation about 8 months ago. I had done a small amount of Rails on 2.x but not enough for anything terribly advanced to lodge in my memory. My background is not CS, but I have used multiple languages and frameworks over the roughly 20 years, latterly with a bias towards .NET and C#. (Although I have since repented, I do still miss certain things about C#, but that's another story.)
I started with the Rails Tutorial - http://ruby.railstutorial.org/ - stepping through it laboriously even though some of it was stuff I already knew or was obvious. At every stage I verified that the tests ran and that the output in the browser was as expected. Finding and fixing problems taught me a lot.
Having completed that, I had a personal project that I wanted to do and so I battled my way through that using the stuff I had learned from the tutorial and brute force web searches/trying stuff. I also had a copy of the most recent edition of The Rails Way on my desk. That's a great book, but it would have made no sense to me if I hadn't done the other stuff first.
One of the things that tripped me up was the switch to CoffeeScript and the asset pipeline which weren't covered in any of the resources at the time (this might have changed since).
I then started on a big Rails project (still going at the time of writing).
We're not using RSpec or Cucumber, but rather MiniTest with FactoryGirl and Capybara, so there were differences there that I needed to master. I was (and am) very lucky to be sitting next to Murray the whole time, and he's been very patient with my stupid questions. Just looking at and trying to understand a top notch Rubyist's code was an invaluable help, but nothing beats asking stupid questions and getting patient replies.
The things I had most difficulty with were routes (when we strayed from the basics) and associations (the same). I also had difficulty writing sensible and useful functional tests.
Initially, FactoryGirl and Capybara were indistinguishable from magic. One of the biggest issues for me was distinguishing at what level the ninja shit was occurring: in Ruby itself, in Rails, in a gem or in magic in our lib folder, or some combination.
I'd say that a thorough grounding in routes, associations and validations are a must, as is understanding how tests work and what a good, repeatable test looks like.
I can't speak for the results, but I feel like I understand heaps more than I did at the start and I seem to be asking fewer stupid questions. There are undoubtedly other resources that could have assisted me, but the ones I mention here worked well.
For what it's worth, I didn't try to grasp plain Ruby first. Perhaps that would have made things easier though. I still feel like there's loads of stuff in the libraries that I don't fully get, especially in collections (Paul Battley's talk at Ruby Manor helped a good deal there).
Getting someone to explain rvm/gemsets/gems/bundler/homebrew and all that plumbing also really helped. I feel like it's still far too difficult to get the stack up and running on a modern Mac (Xcode nonsense doesn't help at all there).
Aside from that, subscribing to a bunch of Ruby/Rails blogs, following Rubyists on Twitter, lurking on this list, watching Ruby Manor videos and generally trying to immerse myself in this world also helped immeasurably.
Hope that's useful.
On 15 Mar 2012, at 18:01, Tom Armitage wrote:
> So: I've been using Rails since god, pre 1.0, I think. Not very well,
> mind, but a while, nontheless.
> I'm thinking at the moment about where to begin explaining it to new
> users (in particular: programmers who are very technically competent,
> perhaps with a CS background, but no direct experience of Ruby or
> And, looking at Rails 3.2 in 2012... I realise I have no idea where to
> begin. A lot of what I've learned is stored as diffs on top of "the
> old way of doing things"; it makes sense because I started learning it
> years ago.
> But where would you send a competent programmer in 2012 looking to
> start from scratch with Rails? My usual recommendation has always been
> getting a good grasp on Ruby, perhaps through The Ruby Way or the (at
> the time) excellent Ruby For Rails, which helped me understand the
> language loads, though I fear it now may have dated/be irrelevant.
> Where, say, would you point as a starting point for testing/BDD in
> Ruby, given "four years of the mailing list and user group" isn't
> I'm curious, because every now and then I look at Rails as an outsider
> and roll my eyes a bit...
> Chat mailing list
> Chat at lists.lrug.org
More information about the Chat