Is It Simpler or Just Your Own Idea?

There is a great emphasis, and rightly so, on writing software as “simply” as possible. Simple software is easier to understand and maintain, bugs are easier to spot and fix, and its easier to verify that the system behaves as specified. There is a constant tug-of-war between simplicity and complexity. I see three sources of complexity in […]

Expressing Sameness and Difference in RSpec

There are many simultaneous goals in testing software. One is certainly to verify that your system works, but its also important that tests express what your system does. When tests are expressive, they enable developers to understand unfamiliar parts of the system, and provide an anchor for discussions about how new behavior should be added. Here’s […]

Never Schedule Future Jobs

There are many situations in which you might be tempted to schedule a job in the future. Maybe you want to want to follow up with a user a few days after they purchased something to see how they’re liking it. Maybe you want to record some summary metrics a week after a new user […]

Recovering from “Fat Model, Skinny Controller”

Like many programmers, I’ve had a long, tortured journey through the world of software design as I did what worked in the moment and only later discovered the consequences of my decisions. I was especially “lucky” in this respect as my first professional software job was as the sole architect of what became two 20k+ […]

Refactoring the Rails Model

It feels like the Rails Model violates the Single Responsibility Principle right out of the box. Wouldn’t this be an easier way to write a non-trivial Rails application? # lib/ # models/ # item/ # creator.rb # query.rb # record.rb # validator.rb module Item class Creator < ActiveRecord::Creator def call! super ElasticSearch.item_created!(item) # … other […]