RSS
 

Ruby Best Practices: A Review

06 Jul

One of my favorite simple pleasures is reading a technical or instructional book where the level of complexity perfectly matches my expertise.  I’ve been enjoying this exact experience while reading Greg Brown‘s new book, Ruby Best Practices.

I have been programming professionally for over three years, with the last five months doing full time Ruby on Rails development.  I would label myself an intermediate Ruby user: comfortable with the basics, but with limited exposure to its more advanced topics.  Lately, I have been reading more and more open source Ruby projects, and have been looking for ways to contribute back to our teriffic community.

Given my experience and goals, Ruby Best Practices was a perfect read.  The book is a collection of general strategies for solving problems in Ruby, with a focus on real-world code examples. Its author is an experienced Ruby developer who also happens to be an excellent writer.

Ruby Best Practices has a number of notable strengths. First, Brown is highly pragmatic. When discussing closures, he writes “I could show some abstract examples or academically exciting functionality such as Proc#curry, but instead, I decided that I wanted to show you something I use fairly frequently.”  This attitude has lead to a book that is full of ideas you can actually use.  It feels like the experienced guy down the hall showing you all his best stuff.

Secondly, RBP’s examples are almost uniformly excellent.  As contributor or creator of several popular Ruby projects (Prawn and Ruport) Brown has no lack of real-word code examples to choose from, and he does so with skill.  In addition, he’s not shy about trimming down the examples to leave behind just the most relevant code elements.  These two factors combine to produce code listings which are indicative of real open-source programs while remaining quite comprehensible.  Not only are Brown’s examples excellent, but they are plentiful.  Nearly every new idea he introduces is demonstrated through a case study of real (or plausibly real) code.  Working through this book will definitely sharpen your code-reading skills.

Beyond simply being clear, Brown’s writing is also fun to read.  His enthusiasm for the subject matter is obvious: “I could stop here and move on to the next topic, but similar to when we looked into the belly of lazy.rb earlier in this chapter, I can’t resist walking through and explaining some cool code.”  This sort enthusiasm continues throughout, and leads to a technical book that I’m tempted to call a page-turner. Making my way through the book really excited me to read and work on open-source projects.

If you’re still on the fence, take a read through the sample chapter, Mastering the Dynamic Toolkit.  Or, if you’d prefer a quicker read, check out this post on the book’s blog to get a feel for Brown’s writing style.  If you like what you see, don’t hesitate to pick up a copy of this excellent book.

Chapter Titles:
1.  Driving Code Through Tests
2.  Designing Beautiful APIs
3.  Mastering the Dynamic Toolkit
4.  Text Processing and File Management
5.  Functional Programming Techniques
6.  When Things Go Wrong
7.  Reducing Cultural Barriers
8.  Skillful Project Maintenance
A.  Writing Backwards Compatible Code
B.  Leveraging Ruby’s Standard Library
C.  Ruby Worst Practices

 
11 Comments

Posted in ruby

 

Tags:

  • http://paulbarry.com Paul Barry

    I’ve been hearing nothing but positive things about this book. Thanks for the review, I’m going to have to pick up a copy!

  • http://blog.rubybestpractices.com Gregory Brown

    Thanks for the very kind words. If you don’t mind, can you copy your review over to the book’s amazon page?

    http://www.amazon.com/gp/product/0596523009

    It sounds like you were definitely within the target audience I was shooting for, and I’m really glad you found the book useful and enjoyable at the same time.

    -greg

  • http://www.khelll.com/blog khelll

    I’m at the last chapter of this excellent book. The way the author has categorize things, and the tips, and even how to design cool interfaces is very cool. I recommend this book as for any Ruby developer whatever skill he has.

  • http://www.supaspoida.com Lar Van Der Jagt

    I’ve got this on the way myself, was already looking forward to digging in but now even more so.

  • Ben Orenstein

    Greg,

    Done!

    -Ben

  • http://nuttersmark.com Mark Nutter

    I’m picking up a copy of this book now and following you on Twitter. I’ve been at Ruby and Rails professionally for just under three years myself. Glad to have found your blog!

  • http://www.joegrossberg.com Joe Grossberg

    Awesome. I am tired of theoretical musings, or examples that have no bearing on the real world.

    That seals it for me: off the wish list, and into the shopping cart.

  • https://intranet.oreilly.com/confluence//display/PR/June+2009+Reviews Confluence: Public Relations

    June 2009 Reviews…

    ADO.NET 3.5 Cookbook ADO.NET 3.5 Cookbook is a very complete book with a lot of examples that cover just about any aspect of working with data under .NET. There are a lot of program examples and its layout of stating a problem,……

  • http://blog.ennuyer.net/rails-reading-backlog/ Ennuyer.net » Blog Archive » Rails Reading backlog

    [...] Ruby Best Practices: A Review : Codeulate. [...]

  • Ben Orenstein

    Thanks Mark! Glad you liked it.

  • https://intranet.oreilly.com/confluence//display/PR/July-Sept+2009+Reviews Confluence: Public Relations

    July-Sept 2009 Reviews…

    97 Things Every Project Manager Should Know A new Project Manager would need several lifetimes of experience to acquire the wisdom of these established team leaders,……