Categories
Uncategorized

Single use kitchen gadgets and the Unix philosophy

Unix tools vs. Me-nix tools vs. We-nix tools.

Alton Brown famously hates single use kitchen gadgets, which he calls unitaskers:

And yet the Unix philosophy says that programs should “do one thing and do it well.” Why does it work for command line tools but not kitchen gadgets?

(You may say “uh, because kitchen gadgets have nothing to do with command line tools?” And you’re right, but shut up. I’m cooking up a metaphor here.)

The answer is that Unix programs are chain-able. They integrate with each other. You can pipe the output from one into the input of another. That’s actually the lesser known second part of the Unix philosophy: “Write programs to work together.”

Kitchen gadgets are standalone. You can’t hook a strawberry slicer up to an egg cooker and expect magic to happen.

There’s a lesson here. Standalone development tools with generic inputs and outputs are good. Those tools follow the Unix philosophy.

But standalone development tools that you can’t pipe together are bad. Those are the single use kitchen gadgets of the development world. It’d be better to choose a tool that does many things than a tool that does one thing and only works in a silo.

I like to talk about Unix vs. Me-nix vs. We-nix (get it?).

  • The Unix philosophy: “Do one thing and do it well.”
  • The Me-nix philosophy: “Do one thing and go to hell.”
  • The We-nix philosophy: “Do lots of things pretty well.”

To take a real life example: say you’re building a recommendation engine. You could reach for something like AWS Personalize, a single use kitchen gadget (aka a Me-nix tool). Or you could grab something like Neo4j, a graph database that does lots of things including recommendations (aka a We-nix tool).

Go with AWS Personalize and you’ll be happy as long as you’re in its core use case. But say you grow out of that. Maybe you need to store and retrieve some arbitrary data about the user. Then it’s time to integrate.

And since integration with AWS Personalize isn’t as simple as piping, you’re going to have a bad time. You’ll be dealing with duplicate user records stored in many systems. You’ll need data in one system to inform data in the other. It all gets very mucky.

If only you had ditched the Me-nix tool and reached for the We-nix tool. You could have had a single source of truth for all of that arbitrary data, and generated recommendations based on it.

My rule of thumb is that Unix tools are best, but if you can’t find one, choose a We-nix tool over a Me-nix tool.


Thanks for reading! Subscribe via email or RSS, or follow me on Twitter!