Why’s (Poignant) Guide to Ruby

June 1, 2007

I’ve just started reading Why’s (Poignant) guide to Ruby.

The writing style is a little different to most technical books but that’s what makes it interesting.

Why's (Poignant) guide to Ruby.

Here’s an example from chapter 1…

One day I was walking down one of those busy roads covered with car dealerships (this was shortly after my wedding was called off) and I found an orphaned dog on the road. A wooly, black dog with greenish red eyes. I was kind of feeling like an orphan myself, so I took a couple balloons that were tied to a pole at the dealership and I relocated them to the dog’s collar. Then, I decided he would be my dog. I named him Bigelow. We set off to get some Milkbones for Bigelow and, afterwards, head over to my place, where we could sit in recliners and listen to Gorky’s Zygotic Mynci. Oh, and we’d also need to stop by a thrift store and get Bigelow his own recliner.

I thought the author (Why) did a great job of explaining global variables to beginners…

Some parts of your program are like little houses. You walk in and they have their own variables. In one house, you may have a dad that represents Archie, a travelling salesman and skeleton collector. In another house, dad could represent Peter, a lion tamer with a great love for flannel. Each house has its own meaning for dad.
With global variables, you can be guaranteed that the variable is the same in every little house.

Leave a Comment

Previous post:

Next post: