George Brocklehurst makes things for the internet.

Work, projects, and curios

Latest writing

Testing Null Objects on the thoughtbot blog

A Null Object is a drop in replacement for one of the other objects in your system that provides sensible defaults when the other object is unavailable. For example, I recently wrote about returning the path to a blank partial as a sensible default for to_partial_path. Null Objects remove respond_to? and nil? checks, and make code cleaner and easier to understand. It almost seems like there’s no downside. Almost. More…

Elsewhere