Ruby Midwest 2011 Confident Code by Avdi Grimm

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 points 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

Related Talks

Make awesome command line apps with ruby by Dave Copeland

Tired of maintaining your one-off script that has now become someone's job to execute? Wishing you could create polished applications on the command line similar to git or cucumber? In my talk, I'll talk about what makes a command line application "awesome", and why you should care. I'll talk about ...

Refactoring from Good to Great

Most developers know enough about refactoring to write code that's pretty good. They create short methods, and classes with one responsibility. They're also familiar with a good handful of refactorings, and the code smells that motivate them. This talk is about the next level of knowledge: the things advanced developers know ...

Scala Monads: Declutter Your Code With Monadic Design

In this video tutorial, Dan Rosen will show you how to use Scala's capacity for monadic design to eliminate repetitive boilerplate in your code. You'll learn to recognize places where the perpetual clutter of null checks, try-catch blocks and more can be hidden within a monad, to make your ...

Elixir: The Power of Erlang, the Joy of Ruby

Dave Thomas
an hour
I'm a language nut. I love trying them out, and I love thinking about their design and implementation. (I know, it's sad.) I came across Ruby in 1998 because I was an avid reader of comp.lang.misc (ask your parents). I downloaded it, compiled it, and fell in love. As with ...

Simplicity Matters

Rich Hickey, the author of Clojure and designer of Datomic, is a software developer with over 20 years of experience in various domains. Rich has worked on scheduling systems, broadcast automation, audio analysis and fingerprinting, database design, yield management, exit poll systems, and machine listening, in a variety of languages. ...