In praise of the golden hammer

Photo credit: Patrick via Unsplash

If you have a hammer, everything looks like a nail.

The Golden Hammer is one of the best known anti-patterns. The idea is that, if you have a particular tool, especially a tool in which you have invested large amounts of effort and money, then every problem looks like something that is best solved using that tool.

If you work in enterprise technology, there is a high chance that you have experienced the golden hammer anti-pattern. For example, I once worked on a system that had to process real time data and store the results in a database. This was before the days of event buses, and the architects of the system decided to use stored procedures and triggers (bits of code embedded in the database that run when you do something, such as read or create a record). This wasn’t a bad idea to start with, except that everything became a stored procedure or trigger. Eventually, it seemed that the database contained more code than data, and inserting one record triggered cascading logic which took seconds to process - which might have been fine if we hadn’t been receiving thousands of records per second. The answer, of course, was to refactor the system, using a wider variety of tools and techniques than the golden hammer on which the team had become fixated.

It sounds as if golden hammers are always bad. But maybe that’s not right . . .

As someone who has written code for most of their life, I am acutely aware that software is my personal golden hammer. There are few problems, other than those which have a physical or emotional element, where I don’t find myself thinking, perhaps this is a job for software. That’s why I tend to be an optimist about trends such as autonomous vehicles: I look at all of the slow progress and setbacks and can’t help thinking that there’s a software solution in there somewhere.

I don’t think I am unique in this tendency: I think that it is common to people who have spent a lot of their lives building and running software. We tend to look at the world in terms of information flows and information processing, and wonder why we are filling in paper forms, or manually chasing steps in a complex process when software could do the job so much better. It’s difficult to find a more frustrated person than a software engineer trapped in a manual process who knows that it doesn’t have to be this way.

While this feels like we are prey to the golden hammer anti-pattern, I suspect that it may be the case that, if we look at the world in this way, we are actually right.

Software is more like a golden Swiss Army knife than a golden hammer: it doesn’t do just one thing, it does almost anything. In fact, even the Swiss Army knife is an imperfect analogy: it is as if the knife does not contain a fixed array of tools with specific purposes, but whatever tool I need at the time I need it - as long as I can describe it precisely enough. If software is a golden hammer, it exhibits one of the most important properties of gold: it is highly malleable.

I think that the degree to which people appreciate this malleability is one of the greatest sources of tension between ‘technology’ people and ‘business’ people. ‘Business’ people are looking for a specific tool to do a specific job, that performs predictably and reliably, and keeps on doing the same thing indefinitely. They feel that they are buying something like a lawnmower or a screwdriver. ‘Technology’ people know that they have an infinitely malleable resource at their disposal, that it is far more powerful than most people imagine, and that if they only had the chance to apply their imagination, they could solve much more than the problem in front of them. They feel that they are building something which is the first draft of reality.

This is one of the reasons that I encourage everybody, whatever their job, to spend at least some time learning to code. This is not because I expect them all to become professional software developers (although we could do with some more of those). Rather, it is because at least some of those people will learn to look at the world differently. There is a moment of revelation which comes when you realise three things: first, that by typing simple pieces of logic into an editor, you can get computers to do what you tell them; second, that you can combine those simple pieces of logic to do almost anything you want; and third, that the world is full of computers.

Usually the golden hammer is an anti-pattern: it is a way of squeezing the problems of the world into a shape which suits the one tool you have. But if the tool you have is infinitely malleable, the golden hammer may stop being an anti-pattern: it may just be a way of looking at the world differently.

Previous
Previous

Speed bumps in reality: overcoming failed attempts at change

Next
Next

Three predictions: probably wrong; possibly useful