Skip to content

Ruby Pickaxe Book 4th edition

September 2, 2013

The Ruby Pickaxe book is actually Programming Ruby 1.9 & 2.0 (4th edition): The Pragmatic Programmers’ Guide by Pragmatic Bookshelf authors Dave Thomas, Chad Fowler and Andy Hunt.

I have the second (Ruby 1.8) and third (Ruby 1.9) editions of this book and started with the 1st edition freely available online. Since I bought the 3rd edition book during the Ruby anniversary sale for $10, I got a free eBook upgrade for the 4th edition so I thought I’d give the new edition another read.

Usually, when I read this book, I skip over Parts 1 & 2 and dive right into Part 3 “Ruby Crystallized”. However, this time I re-read the entire book Chapters 1-26 (not Chapters 27- built-in Classes/Modules & 28- Standard Library or appendices). I’m happy I did that this time because although chapters 27&28 are references to standard library and class changes, the earlier chapters nicely point out the most relevant changes.

Some highlights there were covered well and that are new in Ruby 2.0:

  • Default encoding is now UTF-8, instead of US-ASCII (1.9 and earlier).
  • Module ‘prepend’ allows module methods to be called BEFORE the methods of the same signature in the class that prepended the module.
  • Keyword arguments … that was a long-time coming to cleanup methods that take an options hash.
  • %i to create an array of symbols.
  • Lazy enumerators - (0..Float::INFINITY).lazy.select { |n| puts n if n%42==0 }.next
  • TracePoint
  • Refinements (as of ruby 2.0.0p247) still provides a warning that it is experimental.

This is not an exhausting list of all changes, Ruby MRI’s GC has some major changes, require() had some performance improvements, and much more.

Definitely a great Ruby book for all levels, and a good idea to re-read it fully if the last time you did was a long while ago. Especially if you’ve been in the Rails-only world for a while.

Advertisements

From → Books

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: