Friday, January 03, 2014

Three thoughts from Ruby Under a Microscope Author, Pat Shaughnessy

I'm reading two great Ruby books right now (reviews will be posted soon): Ruby Under a Microscope
 and  Practical Object-Oriented Design in Ruby. I like them both, for very different reasons.  Today, I'd like to share a little bit about the first.

Pat Shaughnessy (@pat_shaughnessy) has written a great book about how Ruby really works. After getting just a couple of chapters in, I really wanted to pick his brain, and he was kind enough to answer my questions.  Now, I'm sharing his answers with you.

What was the most important thing you learned about Ruby while working on your book?

As I studied Ruby over the past 2 years while working on the book, I’ve been surprised and intrigued by how much of Ruby’s design - and implementation - is based on older computer languages, particularly Smalltalk and Lisp. It’s amazing to me how important the basic computer science research done in the 1960s and 1970s by John McCarthy and his contemporaries really is. It’s almost as if we are all “standing on the shoulders of giants." (Not sure who I'm quoting here…) Learning about these older languages has allowed me to look at Ruby with a new light.

This really hit home for me. I've spent a little (not enough) time looking at Smalltalk and Lisp, and that kind of excursion always makes me think differently about programming (and computing in general).

What do you hope others will take away from reading it?

The main thing I hope readers take away from the book is an understanding and appreciation of the computer science concepts behind how Ruby works. For example: hash tables, garbage collection, closures, stack-based virtual machines and compilers, heap vs. stack memory, LALR parsers… etc. Understanding how Ruby works internally allows me to be more confident while writing Ruby code.

Also, I used a lot of diagrams in Ruby Under a Microscope for two reasons:
  • A picture is worth 1000 words - by using diagrams I was able to explain things better than I could have with just text.
  • But also, and possibly more importantly, I’d like readers to build up a visual model of what Ruby is doing that will pop back into their head the next time they write Ruby code.
Again, this makes me feel better about my side trips into those computer science topics that I enjoy - until they start making my head hurt.

Now that you've successfully published a (really nice looking BTW) Ruby book, what's next for you?

Thanks! Yea, No Starch did a great job with the cover and interior layout. So glad I worked with them.

For right now, I’m just going to be focusing on doing normal Ruby development work. I also hope to learn more about functional languages such as Clojure and Haskell, and I’m also curious to learn more about other new languages such as Go and Rust.

I also want to continue sharing my knowledge in public. I’ll keep blogging, and might try my hand at screencasts and other forms of media. I just finished producing a guest episode for Avdi that will appear in his “Ruby Tapas” series which I’m excited about. Whatever media I end up using, my focus will remain the same: explaining complex topics in a simple way, and touching on the computer science that serves as a foundation to everything we all do today as developers.