“Confident Ruby” now in Beta!

Confident Ruby 3DHey, remember when I said I’d finish Confident Ruby by September 1, 2012? Ha ha! That was a funny joke!

Seriously though, this book has taken much longer than intended, partly as the scope grew, but mostly because of other projects getting in the way. Such as the launch of RubyTapas. I’m hugely appreciative of all the early-access buyers who supported the project and have been patient through this process.

Those early buyers have already heard the news, but now I’m letting the rest of the world know: as of now, Confident Ruby is finally content-complete and entering a Beta phase. That means that while there is plenty of editing, clean-up, and tweaking to do, all the major content (a little over 150 pages’ worth) is now in place.

I intend to spend one month getting Confident Ruby into shape for a final release. At the end of that month, I will be raising the price to $35. Until then, you can still get it for $25. As always, if you don’t have the scratch you can send me a postcard instead.

UPDATE 2013-08-26: Confident Ruby is done! Go here to purchase a copy.

Curious about what’s inside? The nutshell version is that this is a patterns book, focused on the method level of code. It’s all about how to make methods that are “confident”: that is, they tell a clear, straightforward story without a lot of distracting provisos and digressions. In order to get you from “timid” code to confident code, I lay out 32 patterns for collecting input, delivering output, and handling failure within a method. There’s a strong emphasis throughout on removing the scourge of nil values from code, and replacing them with more semantically meaningful constructs.

Here’s the current table of contents, if you’re curious:

  • Introduction
    • Ruby meets the real world
    • Confident code
    • A good story, poorly told
    • Code as narrative
    • The four parts of a method
    • 3.times { rejoice! }
    • Collecting Input
  • Sending a strong message
    • Conditionally call conversion methods
    • Define your own conversion protocols
    • Define conversions to user-defined types
    • Use built-in conversion functions
    • Use the Array() conversion function to array-ify inputs
    • Define conversion functions
    • Replace “string typing” with classes
    • Wrap collaborators in Adapters
    • Use transparent adapters to gradually introduce abstraction
    • Reject unworkable values with preconditions
    • Use to assert the presence of Hash keys
    • Document assumptions with assertions
    • Handle special cases with a Guard Clause
    • Represent special cases as objects
    • Represent do-nothing cases as null objects
    • Substitute a benign value for =nil=
    • Use for defaults
    • Use symbols as placeholder objects
    • Bundle arguments into parameter objects
    • Yield a parameter builder object
    • Receive policies instead of data
  • Delivering Output
    • Write total functions
    • Call back instead of returning
    • Represent failure with a benign value
    • Represent failure with a special case object
    • Return a status object
    • Yield a status object
    • Signal early termination with =throw=
  • Handling Failure
    • Prefer top-level rescue clause
    • Use checked methods for risky operations
    • Use bouncer methods
  • Refactoring for Confidence
    • MetricFu
    • Stringer
    • Parting Words

And here’s a video of the talk that started it all:


And here’s that big friendly “buy now” button again!

[cta size=”medium” action=”Buy Confident Ruby now” url=”https://shiprise.dpdcart.com/cart/add?product_id=39130&method_id=39361″]


  1. I wish you offered print books…I can’t read that much content on the computer or an iPad…I get lost on where I’m at, my eyes get tired faster, and I’m distracted by the rest of what is grabbing at my attention, plus no highlighting or sticky noting pages. Just food for thought.

    1. You can get a printed version of Exceptional Ruby from the Pragmatic Bookshelf store. I’m hoping to make something along those lines happen for this book as well. Stay tuned!

  2. Hey Avdi,

    I just got the book and I’m really enjoying it thus far. Great work as usual. If I come across an error how can I let you know about it.

    For now I’d just tell you right here: On page 33, Indirect Inputs, I think you meant the #now message and not the #new message. It should be “Then we send it the #now message.” and “… the return value of #now, …”.

Leave a Reply

Your email address will not be published. Required fields are marked *