lixo.org

On Socks and Services

Every morning, you have a shower and put some clean socks on. You might still wear the same trousers as the other day, or that t-shirt you wore last friday. Or even an inside-out pair of boxers if you just can’t be bothered. But in the name of all that’s sacred, you need a fresh pair of socks every morning. Don’t dispute this fact.

And there are millions of ways to end up with at least one pair of fresh socks in your drawer, but it’s basically down to either constantly buying new ones, washing them yourself or getting someone else to do it for you, with various degrees of automation.

Suppose, like me, you already tried to buy a 7-pack of socks every week for about two months and realised that was a bad economic decision (and also not a very ecological one), and that you want to dedicate your time at home to learn how to cook that stuff you see on Cooking For Engineers, instead of having to constantly remind yourself to do the laundry. You just don’t want to think too much about it, if at all.

In fact, you want to minimise your involvement in the time it takes to do it, even if the task itself takes a bit longer. The laundrette next door seems like a good idea in this case - your involvement is reduced as now you don’t have to do so many little washes because of the laughable size of the washing machine in your flat.

This would be the equivalent of something like a Web Service. You have to go there, in baskets as big and full as possible as to avoid doing too many trips. You’re subject to environment instability (after all, it’s annoying to walk there in the rain or if the network is playing up) but the economies of scale make it quite cheap. Amazon S3 is a great example.

Then there’s the other laundrette on the high street, which offers pick-up and drop-off. You have even less involvement because now even the question of how your socks get to the service is out of your mind. An equivalent would be a good runtime library - you don’t care how it does it, you just tell it to do stuff, and it works. The environment doesn’t interfere as much, but contrary to the laundrette example, libraries are a lot cheaper to use - in fact, you’ll see in this an inverse relation of cost between the examples.

If you really don’t want to think about the socks, though, you’ll want to hire a maid. A maid will set you back a considerable amount, but your involvement is absolutely zero and your clothes would get washed as soon as they become dirty: a considerably better service. An equivalent would be language runtime features such as a GC, which are almost invisible except when you attend to the fact you’re not doing it yourself.

From there, we can extrapolate:

As software developer-facing services become more elaborate, they require less involvement and cost less to use.

As sock-washing services become more elaborate, they require less involvement and cost more to use.

I imagine we can all quickly understand now why asking your girlfriend to do your laundry is a bad idea, but I’m not sure what’s the software development lesson from all of this.