Ruby, etc

Learn all the things

He who enjoys doing and enjoys what he has done is happy. - Fortune Cookie

Reading Books Cover-to-Cover

I wanted to buy “Practical Object-Orientated Design in Ruby” by Sandi Metz when it first came out, and I had a hard time justifying it because there are many books I have bought and have not read all the way through. So I thought I’d do an experiment in reading a tech book cover-to-cover and then I’ll buy “poodr”. So my first cover-to-cover read was Eloquent Ruby by Russ Olsen. Not all books should be read cover-to-cover but when you read a book cover-to-cover you’ll discover a few things:

  • what topics are there and how deep they are
  • what topics are not
  • the sequence and structure of the book, about where things are so its easier to flip back to review

And lastly, you’ll be able to speak authoritatively to someone when you say “Read this book!”

I bought Eloquent Ruby perhaps 1.5 years ago, and after the first couple chapters decided it was the most awesome book ever and how much smarter I would have been had I gotten it sooner. I read maybe 1/3 of the way through, I skipped around some, the testing chapters and the metaprogramming. Even with skipping around in the book, I quickly became an evangelist for this book. I told every ruby developer I encountered to buy it, I even got a copy for my last company. It’s just plain good, you’ll learn the ruby idioms and why. I’ve been programming since I was 13 and got pretty good at memorizing the syntax of things, not truly understanding why or how, but “type this thing to do that thing”. But Eloquent Ruby helped me understand why behind the syntax. Now that I understand “why”, it is so much easier to remember without relying on memorization.

That is why I chose this book to read as my first cover-to-cover read.

I needed a way to keep track of my progress since I use different devices and software (mac, iphone, ipad, android nexus) I can’t rely on a cloud service to “sync my place” across all of them. I use an Evernote note with all the chapters as a checkbox list. Plus, I love checking things off a list. I would see my progress and be able to pick back up where I left off each reading session. The chapters in Eloquent Ruby are pretty short, so it was easy to read in small chunks of time. I read it at break at work, on the bike at the gym, riding in car, just about anywhere. It took a couple months to get through all the chapters this way.

It didn’t take long to realize one of the benefits of reading cover-to-cover. When I was almost done with the book, a friend was having problems with some concept in ruby and I remembered there was a chapter about it, near the beginning of the book. I flipped around a few minutes and found the prefect chapter for her to read. Had I not read it cover-to-cover I may not have known that content was there or wouldn’t have been as confident recommending it and my “find it in this chapter” instructions.

My “reward” for finishing Eloquent Ruby was to get Sandi Metz’s book “Practical Object-Orientated Programming in Ruby”.

I followed the same process and created a list of chapters in Evernote, planning to read them in bits at home, gym and work breaks. At only 247 pages, it is quite a bit shorter than Eloquent Ruby with 447 pages so I knew it would take alot less time.

Chapter 1 came easily enough and I checked it off. Then I was surprised to find out what followed was that I could not put the book down. Instead of my next reading time or gym appointment, I read till 2 in the morning, picked back up and finished it the next morning (it probably helped that I was home sick with the weekend to myself). I was so excited about what I was learning, I wanted to stop reading and refactor code I wrote a few days ago. I so wanted to skip ahead to Chapter 9 on tests. However, I stuck to original plan of cover-to-cover and read all the way through. It is an incredible book.

I say incredible not just because “I learned the right way” but because it validated so many instincts and gut feelings I have about class design. Having those things in writing gives a source to “cite” in discussions and confidence to say “Yes, this is how we will do this thing”.

So as a result of my experiment I would recommend these two things to anyone wanting to improve their knowledge of ruby:

  1. Get these two books.
  2. Read them cover-to-cover.

I’m confident that you will enjoy both the information and the reading experience.

BTW these are affiliate links, maybe I’ll earn enough to get a cup of coffee eventually.

Comments