Monday, May 16, 2011

Coffee and its Effects on Feature Creep

Starting in mid-2004 and until the end of 2006, I worked at a small DNS and DHCP software company called Nominum.  These days Nominum offers both software and services, but at its core what has allowed it to be as successful as it has been is the fact that its development group is, singularly, the most brilliant and personally committed to the company group of developers I've ever seen.  Most of the developers with whom I worked had been there from just about the beginning of the company.  It was the sort of environment where my VP was still doing the Costco shopping (though admittedly she enjoyed it), everyone knew every other employee's spouse's name, and we got together to have our dogs play. 

That's less relevant, however.  The two introductory bits of information necessary for this posting are:
  1. Nominum at the time had tons of RPI alumni, and because of this had implemented an RPI-sourced chat system named Lily.  Lily is more IRC-like than Yahoo Messenger-like in the sense that it's largely oriented toward offering multi-person chats (in IRC these are channels; in Lily these are called discussions); you can also send private messages, but it's typically used less often; Lily was very heavily used (one of the earliest lessons I had to learn was that if it was 1AM and my boss just sent me a private message asking me a question or asking me to take care of something, it was OK to say "actually, I was about to go to sleep; I'll deal with it in the morning."  It took me some time to learn this lesson);
  2. We worked approximately a mile away from Starbucks, and we went for coffee every day.
The problem was that the coffee ordering process was just terribly inefficient.  At some point in the day, someone would pop up on the "coffee" discussion and send out a broadcast "coffee?" to all interested parties.  At that point, people would have to say on the discussion what they want (e.g. "I'll have my venti non-fat 180 degrees vanilla  latte with two equals, extra squirt of vanilla, and whipped cream."  No, seriously, that was my drink at the time), the person who was volunteering to go would then write the order down (with a pen and a piece of paper), they'd go to Starbucks where the barista would have to decipher their handwriting, and make the drinks.  Typically, the person who went to pick up would pay for the whole order and then would try to keep track of how much each person owed them (people did not often have the exact cost of their drink available).

It doesn't take too many iterations of this to get a little sick of the inefficiency.

Lily was really easy to interact with -- it was a telnet-based interface, and we weren't doing any encryption.  Writing a bot to interact with Lily proved to be a trivial task.  I called it Caffeinator.

By the end of the first weekend of development (this was, obviously, a rather extra-curricular sort of effort), Caffeinator could see that ordering was opened, then listen to people saying "I'd like X," from which it would create a shopping list which it could post as a web page.  When ordering was closed, the person doing the shopping could visit the web page and print it out.  The order takers were happy.  Starbucks was happy.  Success.

It was still painful to have to say "I'll have my venti non-fat 180 degrees vanilla latte with two equals, extra squirt of vanilla, and whipped cream" every day.  So it was easy to have Caffeinator start keeping track of your favorite.  Saying "my favorite gnfl is a grande non-fat latte," for example, meant you could next time simply say "I'll have my gnfl" and Caffeinator would note you wanted a grande non-fat latte."

In rapid succession, we added the ability for it to optimize ordering for the Starbucks drink carriers (Starbucks drink carriers accommodate four drinks; ideally, all four drinks are similarly sized for balance, but at minimum it's preferred to have two pairs of identically-sized drinks).  We also added the ability to order for other people (so if I'm in John's cube when coffee ordering is open, John could say "Roy will have his gnfl") and the ability to define other people's drinks, if they let you (yes, I implemented coffee drink definition ACLs).  And that was still not that big of a deal.  It all sort of made sense.

In hindsight, it was probably right around the time that I implemented debt tracking into Caffeinator that I should have taken a break from enhancing it and reconsidered whether feature creep had gone way too far. 

Remember the part where someone comes back with your drink and you find out you don't have the $4.15 you owe them? It's annoying.  So after a particularly fun weekend, suddenly debts could be declared to Caffeinator.  Obviously, the potential for mischief when you can say "John owes me $4.15" is high, so the first implementation required people to declare their own debt ("I owe Roy $4.15.").  Of course, I also had to implement debt repayment ("John paid me $4.15").  The next implementation allowed for a proposed debt ("John owes me $4.15," which would result in Caffeinator telling you "John says you owe them $4.15.  If you agree, send me a message including this key: 'xxxasdfasdf325'").   Then, of course, I got curious about the total balance of debt/credit and so had Caffeinator report your TCNW (Total Caffeinator Net Worth) -- your total credits minus your total debts. 

It didn't take long to see some people's TCNW fluctuate way more highly than simply coffee ordering could account for, and realize Caffeinator became the default way in which social monetary debts were being tracked.  Your coworker with Amazon Prime order something for you? "I owe Matt $88.95." 

Once the network of debt and credit became saturated enough, it turned out that most people had dozens of people with whom they carried either a Caffeinator debt or a Caffeinator credit, and I came up with a way to allow people to simplify their credit/debt situation by reassigning debt.  Imagine Jim owes you $10, and you owe Bob $10.  Well, that's easy.  Tell Caffeinator "reassign $10 from Jim to Bob" and suddenly Jim owed Bob $10, and you were out of the picture.  Heck, two people owe you $5 and you owe four people $2.50 each? You can eliminate six credit/debt relationships at once. 

Of course, this being an environment full of mischief, the next thing we had to deal with was people gaming the system just for the sake of annoying others.  Bob owes you $1? Well, declare that you owe twenty people $.05 each, then reassign $.05 of Bob's debt to each of these people.  Suddenly, these twenty people find Bob owes them $.05 for no particular reason and Bob's really unhappy with you.

My last enhancement to Caffeinator was to allow people to opt out of debt reassignment.  That seemed to stop most of the gaming.

And that's how I set out to simplify ordering Starbucks and created an internal banking system. 

11 comments:

  1. As I recall, the author of caffeinator was not immune from gaming it for amusement value and annoying others. =)

    ReplyDelete
  2. It's only feature creep if there isn't the time to implement (and doesn't mess with a clean interface). Otherwise, it's innovation of neat things (provided there is a customer request). :)

    ReplyDelete
  3. found it on hacker news. It's a brilliant piece :)

    ReplyDelete
  4. Awesome story, it is now one of my favorite programming tales ; )

    (found it on reddit)

    ReplyDelete
  5. Easy remedy for the hack you suffered: don't notify people of any debt below a certain threshold. I'd start with $1. You could try and game it, like owing 20 people 99 cents each, but that doesn't sound like a lot of harm.

    Or even better: round all debts to the lower dollar. (If you owe $1.75 to Bob, the system will show you $1.) No more petty cents. Of course, keep tracking cents internally.

    ReplyDelete
  6. Hi, Roy -- it's Kurt Weiske! This point made http://boingboing.net's home page.

    How's tricks?

    ReplyDelete
  7. Enjoyable post. I couldn't help but think of this PBF comic:

    http://pbfcomics.com/136/

    ReplyDelete
  8. Oh, hey Kurt! :). Funny to see you -- and everyone else -- on this relatively old blog post.

    ReplyDelete
  9. And I was always too far away from the office to make use of this

    ReplyDelete
  10. A fine example of the 'Tute Screw at work.

    ReplyDelete
  11. I just lost my comment because I wasn't logged in to wordpress.

    At MX Telecom we had something similar to this (for pasties and chinese food), but just pooled all debts; Bob would owe $1 to some nebulous "the office". We'd get whoever's balance was lowest to do the order, which incentivised people to stay reasonably positive.

    ReplyDelete