Menu Sidebar

Boolean Externalities

The other night I spent a long time trying to figure out why an acceptance test was failing. Eventually I tracked it down to the fact that a particular predicate method was returning false, when I expected it to be returning true.

Ultimately I would find that the test failure pointed back to a legitimate oversight in my code. But I wasn’t there yet. First I had to work my way back to the source of the unexpected false.

Read More

How to use Ruby’s English and/or operators without going nuts

Years ago I wrote about Ruby’s English and/or operators and why they are the way they are. I’ve never been completely happy with how I made my case in that article, and more recently I took another whack at it in a RubyTapas episode. However, until now that episode hasn’t been available to the general public. Today that changes; I’ve made the episode freely available and you can watch it right here.

Read More

Where do ideas come from?

Someone wrote in asking:

you always have ideas… How do you generate ideas to build something?

Which is a great opportunity to pontificate. (I swear, I did not make this question up!)

Let’s get this out of the way: I am the wrong person to ask. I am not an effective “idea guy”. I’m white, male, I was born in the USA, I’m 34 years old, and I’ve been writing software since I was in my teens. If I were any good at ideas, I’d be a millionaire by now.

So you probably shouldn’t listen to a word I say. But I’m going to say it anyway, because there’s nothing quite so much fun as making up answers to the big questions.

Read More

Zero to Smoke Test with Sinatra

The other day I put an app in production with (gasp) no automated tests. I’m careful to say no automated tests, because of course I had been testing it manually throughout the ~12 hours it took me to write the initial version of the app. In lieu of tests, I made sure to log copious amounts of information, which I then collected from my deployed app into Papertrail.

For a single day’s work this was acceptable. But I knew that once I had a version in production, pushing out even the smallest, seemingly benign change would be an extremely dicey proposition without some automated regression tests in place.

Read More

Newer Posts
Older Posts

Virtuous Code

"The three virtues of a programmer: laziness, impatience, and hubris" — Larry Wall

Books and Screencasts

RubyTapas Screencasts

RubyTapas Screencasts

Small plates of gourmet Ruby code.

Confident Ruby

Confident Ruby cover

32 Patterns for joyful coding.

The Making of

Confident Ruby cover

Watch me build an app in Sinatra and Rails

Objects on Rails

Objects on Rails

A developer notebook on applying classic Object-Oriented principles to Ruby on Rails projects.

Exceptional Ruby

Exceptional Ruby

The definitive guide to exceptions and failure handling in Ruby.