Ruby reading material and courses

Part of the Ruby newbie series
12 April 2010 · newbie · ruby · books · tutorials

Books and tutorials

Owing to the popularity of Rails, there are an incredible number of books out there that promise introductions, expertise and Ruby super powers. I haven’t read most of them and obviously, am not in a position to comment on any beyond the few that I have. Perhaps I missed a few gems (pun intended, sorry!) in my brief search and I make no claim that I found the best of the crop. Anyway, what follows is a short description of the way in which I went about deciding on which books were right for me.

I chose to start off with an introduction to Rails. It was pretty clear that I would also need an introduction to Ruby and so I looked for a Rails book that provided this as well. Having had some exposure to the excellent Pragmatic Programmer series, I was tempted to pick up Agile Web Development with Rails. After all, one of the authors, David Heinemeier Hansson, is the creator of the Rails framework. I did buy this book eventually but owing to some advice from @matthewsinclair, it wasn’t the book that I chose to get me started.

I spent some time on Amazon reading reviews of Rails books and based mainly on what I read there, chose to start off with Patrick Lenz’s, Simply Rails 2.

Patrick’s book is fun! It is written in a relaxed style and concentrates on getting the beginner to the point where they have quickly built a simple Rails app (modelled on Digg). It fits the ethos of Rails in that it provides near-real-time gratification and the reader is encouraged by the fact that they’re getting their hands dirty and have something to show for it. His here-hold-my-hand-while-we-connect-the-dots approach has the obvious problem of needing to gloss over the detail. Nevertheless, this is what this beginner needed so as to avoid getting bogged down early. Patrick’s chapter on Ruby basics is good, but basic. I read his book over a couple of sittings, working through the code that he presents and building the app that he uses to illustrate the main aspects of Rails.

@matthewsinclair also recommended Michael Hartl’s work-in-progress tutorial, “The Ruby on Rails Tutorial Book” and referred to here as Rails Tutorial. Michael’s bio mentions his accolades as a teacher at Caltech. Having taught for 8 years or so myself, I can spot a passion for good teaching from ten paces and Michael’s got it! He has successfully ported his teaching abilities to the written word and is developing a tutorial that is simply excellent. Rails Tutorial is written for the complete newbie while containing enough detail and secondary content to make it quite useful to the curious (non Rails) programmer as well. When I came across his tutorial, I had already started on Patrick’s book. I wanted to finish my first foray into Rails, so I put off tackling Michael’s tutorial until after I had finished Simply Rails 2. I don’t regret doing this but suggest to the newbie reader that they will likely benefit from using Michael’s tutorial as a starting point. Some of the highlights include:

  • Using git from the start (so you learn about version control)
  • Consistently pushing TDD (test driven development)
  • Getting you started with an account on Github and Heroku before the end of Chapter 1
  • Building a non-trivial mock up of a social micro-blogging site
  • Integrating with Gravatar and other fun tidbits …

Michael had written 4 chapters (there are a total of 11) when I worked through his tutorial the first time. Chapter 3 is Rails-flavored Ruby, in which he starts off by asserting that:

Ruby is a big language, but fortunately the subset needed to be productive as a Rails developer is relatively small. Moreover, this subset is different from the usual approaches to learning Ruby, which is why, if your goal is making dynamic web applications, I recommend learning Rails first, picking up bits of Ruby along the way.

Well, instictively this clashed with my need to connect with first principles. I’m not suggesting that Michael is wrong – it’s just that at that point in my journey, I felt I needed to shore up my foundations and spend some time with Ruby. Michael makes some suggestions for further reading in the early part of his book and I just followed his recommendation and bought a copy of Peter Cooper’s, Beginning Ruby, Second Edition.

Michael recommends Peter’s book saying,

I recommend that newer programmers read Beginning Ruby by Peter Cooper, which shares the same basic instructional philosophy as Rails Tutorial. After finishing Beginning Ruby, you’ll be ready for Agile Web Development with Rails by Dave Thomas and David Heinemeier Hansson and The Rails Way by Obie Fernandez.

Peter’s writing style is simply delightful! He is funny, relaxed and conversational as he leads you through the basics of Ruby. Using some excellent and non-trivial examples and exercises he gets the reader beyond the reading and into the doing. His book is sub-titled, From Novice to Professional and he achieves this by splitting the book into two parts. The first half is focussed on foundational elements of the language and the second half covers topics like web application frameworks (Rails, Sinatra, etc.), desktop application development etc. This section also provides a whirlwind tour of some of ruby’s main libraries. I find that I use the first half as a reference and when I want to learn about something new (e.g. Shoes), the second half provides for an excellent starting point. There aren’t any formal exercises in the book but he closes the first half with a chapter that builds a large application that pulls together individual facets of Ruby. Peter is also the author of one of Ruby’s chief sources of information on the web, RubyInside and is quite active on twitter.

I’ve also acquired the pickaxe book or Agile Web Development with Rails. I expect that I will spend more time with it as I get my hands dirty with a Rails project or two. At this point in time the print version of this book covers Rails 2 and a beta version refactoring the book to Rails 3 is in progress. I suggest holding off until this version is complete and/or picking up a second hand copy of the Rails 2 version.

Courses

Learning a programming language by getting in there and writing some code is far more effective than (just) reading a book about its foundational elements. If you are an experienced programmer and have a project in mind, cracking open an IDE (or in the case of Ruby, an editor!) is an effective first step. I had a couple of projects in mind (more on this later) but wanted to find something a bit more bite sized and guided. There are some excellent resources targeted at providing exercises to the beginning and intermediate Rubyist and all of them appear to have some form of support or guidance so that you can have questions answered and a critique provided of your solution. My (limited) research uncovered the following:

I signed up for the Core Ruby course at rubylearning.org and worked through 8 weeks of tutorials, exercises and quizzes. The format of the course is described here. In summary, it is free, based on notes and exercises written by Ruby Learning’s creator, Satish Talim and supported by an international cast of mentors. I really got a lot out of doing the exercises every week and getting feedback from the mentors. They suggested variations that I could explore and mistakes that I could try and fix! The interaction with the mentors provided something that books rarely do – I began to get learn more about the ruby way of doing things and (anti) patterns relating to efficiency. I learned some of Ruby’s idioms and my confidence in Ruby programming increased significantly. More than anything, I think Satish delivered on his mission to demonstrate that Ruby helps programmers have more fun! I really did have a lot of fun over the 8 weeks I spent with the course and thank Satish and his merry Rubyists for a great time! Check out Satish’s blog for more information on what he is up to (courses on Clojure, Git, etc.) and for some interesting interviews with top Rubyists exploring their views on effective ways of learning Ruby.

I am excited about exploring rubyproblems.com and the dormant mathematician in me is very curious about checking out the goings on at Project Euler. I expect that I will write about any adventures I have with these sites.

I hope that this article provides some useful points of reference for other newbies looking for books, tutorials and/or courses to help them on their way. In my next post I will write about the role that virtual and physical networks play in my continuing journey with Ruby and Rails.

blog comments powered by Disqus