Null Objects

Nothing is something - Sandi Metz Null objects surface hidden assumptions making code easier to reason about and to change. Consider the number 0. Initially a mathematical placeholder, 0 was imbued with meaning allowing all numbers to be used in new ways. By working with numbers as they approach zero,…

Pundit - Rails Authorization

Problem As your users create and manage data, you need to decide what is visible and editable by any user in the application. You set out by scoping your domain resources to the user or to the user's team and are off to the races! Your service grows (hooray!) and…

Warden - Rails Authentication

Warden is a simple and powerful authentication mechanism for rack based ruby applications. Using a rack middleware, it injects an object into the rack environment which can be used to authenticate incoming requests. At its core, Warden uses 'manager', 'proxy', and 'strategy' abstractions to accomplish its goals. The library shines…

Streams in JavaScript

Time is but the stream I go a-fishing in. -Henry David Thoreau Recently I was rereading Structure and Interpretation of Computer Programs by Abelson and Sussman and was hooked by the section on streams. Streams allow one to reason about stateful phenomena while mitigating "some of the complexities of modeling…

Recursion in Ruby

Studying Ruby and object oriented programming at Dev Bootcamp we have been working with exercises that lend themselves to recursive thinking. Because recursion was challenging yet often elegant I researched the subject further in the context of the Ruby language. For more here is an excellent resource on recursion in…