• Engine Yard
  • LivingSocial
  • VMware
  • Heroku
  • Rackspace Hosting
  • Blue Box Group
  • JetBrains
  • New Relic
  • Percona
  • Pivotal Labs
  • Rails Dog
  • WyeWorks
  • Chargify

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine at yromaine@oreilly.com.

Download the RailsConf Sponsor/Exhibitor Prospectus

Contact Us

View a complete list of RailsConf contacts.

Confident Code

Avdi Grimm (ShipRise LLC)
Location: Ballroom II
Presentation: external link
Average rating: ****.
(4.02, 62 ratings)

Are your methods timid? Do they constantly second-guess themselves, checking for nil values, errors, and unexpected input?

Even the cleanest Ruby codebases can become littered over time with nil checks, error handling, and other interruptions which steal attention away from the essential purpose of the code. This talk will discuss strategies for writing your Ruby classes and methods in a confident, straightforward style; without sacrificing functionality or robustness. In the process, we’ll cover concepts and techniques including:

  • The narrative style of method construction
  • The four parts of a method
  • Three strategies for dealing with uncertain input
  • Massaging input with coercion and the Decorator pattern
  • Lightweight preconditions
  • Exterminating nils from your code
  • The chaining and iterative styles of method construction
  • Eliminating conditionals with the Special Case and Null Object patterns
  • Isolating errors with the Bouncer and Checked Method patterns
Photo of Avdi Grimm

Avdi Grimm

ShipRise LLC

Avdi Grimm has been hacking Ruby code
for 10 years, and is still loving it. He is chief aeronaut at ShipRise LLC, a consultancy
specializing in sustainable software development and in helping
geographically dispersed teams work more effectively. He lives in
Southern Pennsylvania with his wife and four children, and in his
copious spare time blogs and podcasts at http://wideteams.com and

Comments on this page are now closed.


Dustin McCraw
05/23/2011 7:56pm EDT

Great talk. A lot of information to digest but I could tell that Avdi know what he was talking about. Great speaker.

Picture of Conrad Taylor
Conrad Taylor
05/22/2011 11:14am EDT

Great slides even though I missed the talk. The slides have a wealth of information that I will be applying to my software development practices. Next, I look forward to reading more about the subject in ‘Exceptional Ruby’. Bravo!!!!!

Picture of Daniel Barron
Daniel Barron
05/20/2011 8:08am EDT

Excellent talk. Gave me a lot to think about and apply to my work immediately. Agree that the ums did not distract me too much, but also that working on them would make a really good speaker a great speaker.

Well done, Avdi!

Picture of Ben  Hamill
Ben Hamill
05/18/2011 1:23pm EDT

Great content. Made me think quite a bit about how I write code and how I think about the code I’m writing. I didn’t find the “ums” as destructive to the experience as it seems some others did, but I think they’re worth attacking if you want to polish up your style. I think that would turn “great content” comments into “great talk” comments. One of the best sessions I’ve been in so far.

Also, coming down to walk back and forth in front of the screen was, in my opinion, a good call.

Gail E. Harris
05/17/2011 4:00pm EDT

Excellent content! Sadly the message was full of static because the presentation itself didn’t do enough to follow its own advice, suffering from poor storytelling.

Picture of Iain Hecker
Iain Hecker
05/17/2011 11:34am EDT

+1 on the cowsay example. Next time, use sl as example ;)

Graham Jones
05/17/2011 11:10am EDT

Please lose the ers and ums… Very distracting from otherwise excellent content.