Are you someone who cleans the milk jug?

I happened to be in work early the other Monday, which for those of you who know me will find surprising. Since I'm a nocturnal person I was in search of a caffeine hit to get me through the morning and headed down to the breakout room where we have a shiny Nespresso machine (pictured). One of the cleaners normally cleans out the milk jug overnight so that the first people in the office can make themselves a coffee in the morning. Obviously something had gone wrong because instead of a gleaming milk jug that morning I came across a jug with an inch of congealed milk which had clearly been left all weekend.

Now this got me thinking. I had three options as I saw it. I could either forget having a coffee altogether, have a black coffee or clean the milk jug out and make myself a latte. For reasons I've already mentioned forgoing my entirely wasn't an option. Black coffee would solver my immediate problem and cleaning out the milk just would then allow anyone else to make themselves a coffee after.

Some people might recognise this scenario from code bases they've worked in. I certainly do. Every now and then you'll want to add a feature to a piece of code with a dirty milk jug, which of course I mean to be legacy code. You can either avoid putting the feature in altogether, just do the minimum to get the feature in there or add the feature and clean up the code base while you're there.

Of course with our office there was actually a fourth option, I could have gone to one of the other coffee machines dotted around the offices. I purposefully left this one out as it didn't really fit with the coding analogy but it's useful to remember that there's normally another option out there.