A few of you may already know that I’ve started learning Ruby. I cannot tell at this moment if its going to be a huge career shift for me or not, but still, here I am. And I started with Why’s Poignant Guide to Ruby, a definitely… unusual book.
Why’s Poignant Guide to Ruby was one of my first options because it did promise to be unusual, and it was a CC Share Alike freely available option, which I thought was really cool for the community (or in this case, Why) to create. At the point of reading this, I had already peeked at some basic language constructs so I was not a full-fledged beginner, and although the book starts assuming you know nothing about it, it did teach me some facts about the basic structures that I didn’t know about.
The book itself is pretty short, I read it on a PDF-rendered version which amounted to around 200 pages, but it was easily becoming hard for me to follow, since I was paying attention both to the Ruby parts and the sideline stories which are not easy to follow at all. At times I’d find myself trying to make sense on why there was a whole sidebar dedicated to bread questions and answers, or reading about irrelevant comparisons.
However, to give you a proper taste of what’s it like, I believe the best non-irrelevant section is the description of what metaprogramming is like:
Let’s say it’s more like a little orange pill you won at the circus. When you suck on it, the coating wears away and behind your teeth hatches a massive, floppy sponge brontosaurus. He slides down your tongue and leaps free, frolicking over the pastures, yelping, “Papa!” And from then on, whenever he freaks out and attacks a van, well, that van is sparkling clean afterwards.
Now, let’s say someone else puts their little orange pill under the faucet. Not on their tongue, under the faucet. And this triggers a different catalysm, which births a set of wailing sponge sextuplets. Umbilical cords and everything. Still very handy for cleaning the van. But an altogether different kind of chamois. And, one day, these eight will stir Papa to tears when they perform the violin concerto of their lives.
Metaprogramming is packing code into pill-form, such that a slender drop of water could trigger it to expand. More importantly, you can control the pill’s reaction, so that a brontosaurus is produced, scaly and lumbering. Or septulets, CERTAINLY. Or seamstresses. Or cat brains. Or dragons.
While definitely not wrong, I certainly cannot assess if this is right or not
Anyway, the book is funny on its way, but needs to be taken lightly. The contents on Ruby can probably be squeezed into a quick tutorial of 20 or 30 pages, and it does cover everything necessary to create a complete Ruby program, assuming you know your way to organizing your code.
All in all, I think it was a good read, but I’d prefer my technical manuals with more information density.