When I was a kid, I was fascinated by a mechanical coffee vending machine in the break room at my father’s office. My brother and I spent countless hours playing ping pong in that room on Saturday mornings. But, we would stop to watch the coffee machine anytime someone used it. The thing was a brilliant example of human ingenuity.

The wonder began with the sound of a coin rolling through the sorter and dropping into the bucket with a clink. Where all did that nickel go on that journey? It sounded like a much longer trip than one would expect.

Then, once a selection was made, the machine would spring to life. A cup would drop out of nowhere. A series of mysterious sounds would emanate from the contraption: clacking, whirring, and hissing. And, after a while, that beautiful black liquid would spill forth into the cup, piping hot and smelling delicious! It was amazing!

But, that wasn’t all. Sometimes the cup wouldn’t fall. And, the patron had to scramble to find a suitable replacement before the coffee poured out onto the floor. Those failures were every bit as glorious and fascinating as the successes. Why didn’t the cup fall? Was the machine empty? Or, was there a mechanical failure? A sprung spring? Or, an obstruction? So many questions!

Looking back on it now, I think I gained a couple things from that old machine: an appreciation for coffee, and a curiosity for why things fail.

These days, I'm more interested the quality of code bases. And, I have tons of questions: Why do so many applications become so hard to maintain over time? What causes software to go wrong? How can we recognize when it turns on us? What can we do to bring it back? And, how can Ruby help?

In the next few posts, I'll try to answer those questions with the help of my good friend, Fito von Zastrow. We'll build a small application together, a coffee machine controller. We'll watch it turn on us in real time. We'll show you our approach to wrangling it back in line. And, we'll show you a technique that leverages Ruby's strengths to reduce churn and complexity.

So, stay tuned!