the golden hammer

expression

programmingops culture

Over-relying on one familiar tool for every problem, whether or not it fits.

From 'if all you have is a hammer, everything looks like a nail', it describes reaching for your favorite language, framework, or pattern reflexively instead of choosing what the problem needs. The cure is a bigger toolbox and the judgment to know when the hammer is wrong.

If all you have is a hammer, everything looks like a nail. The golden hammer is the anti-pattern of applying a familiar tool to problems it does not suit, and the reason it is so common is that expertise itself produces it: the better you know something, the more solutions it appears to offer.

In practice it looks like storing everything in the database you know, expressing every problem as a pipeline because that is the framework in place, or reaching for the language you are fastest in regardless of what the task needs. Each decision is locally rational, since a tool you know well genuinely does outperform an unfamiliar better one in the short term, and the cost accrues later as the fit worsens.

The defence is not to abandon familiarity, which would be its own mistake. It is to notice when the argument for a choice is comfort rather than fit, to have at least a rough sense of what else exists, and to ask what the ideal tool for this problem would look like before checking whether the familiar one resembles it. The answer is often yes, and the value is in having asked.

Also known as: Maslow's hammer, law of the instrument, if all you have is a hammer

Sources

  • Maslow, 'The Psychology of Science' (1966)

All glossary entries