by Leon Rosenshein

The Law Of Instruments

if all you have is a hammer, all you see are nails.

Kaplan, Maslow, et al.

That’s not exactly what Maslow and the others said, but that’s a pretty common paraphrase. And it’s true. If the only tool you have is a hammer, you tend to treat every problem as a nail and pound on it until the problem is gone. Not necessarily solved, but at least it’s gone. Because of that, you need to know you tools. When to use them, and when not to use them.

However, using the right tool for the right job is only part of the issue. You don’t just have a bias to use the tool at hand. A perhaps bigger problem is that you also have a bias around how you see the situation. Hat Tip to GeePaw Hill who helped me put this into perspective for myself. It’s not really about hammers or nails. It’s not even about tools and uses.

The deeper bias is about the frame you view things in/through. And that’s a very subtle bias. It’s subtle because it operates before perception and cognition. You see things in terms of the frame of reference you’re viewing them from. Back to the hammer and nail, it’s not that you see a screw and decide that the easiest way to make it not stick up is to apply percussive maintainance. It’s that you see a nail, then you think about how to fix the problem of a nail sticking up, and whack it with a hammer.

The situation you’re in, the frame makes you see things not in the way they are, but in a way that fits into your ability to fix. Then you think about it and apply a reasonable solution to the problem, as you see it. The key to countering the bias is to recognize that you might not be seeing what you’re seeing.

Unfortunately, this isn’t the world of Dungeons and Dragons, and you can’t attempt to disbelieve. At least not by just rolling some dice. Instead, you have to do what the roll of the dice simulates. You need to:

  1. Recognize there’s a chance you might be fooling yourself
  2. Examine the situation closely
  3. Decide if you’re seeing what you think you’re seeing
  4. Do something about it.

Of course, the hardest part is the first part. You probably don’t have the time or energy to assume everything you perceive if wrong. After all, the vast majority of it is correct, so it’s just slowing you down. What you can do, though, is identify some of your common responses that might come from misperceptions. Once again, with the hammer and nail. If you see something sticking up that shouldn’t be and you reach for your hammer, look again. If you’re doing rough framing of a wall, it very well might be a nail. If, on the other hand, there’s a lump under your carpet, it’s probably not a nail, so check first.

If you’re building a distributed system and there’s a latency problem your first response might be to use a cache. That might be the answer. But before you go build/install that cache, look at the system again. Maybe you don’t even need to do what’s taking a long time. Maybe the thing you’re looking for changes so rapidly that a cache is the wrong thing to do and you need to fix the response time. Or maybe the problem is your SLO is just too high.

So next time you find yourself swinging that metaphorical hammer, before you make contact, take another look and make sure you’re seeing what you think you’re seeing.