What is a Footgun?

Roel M. Hogervorst

2022/11/21

Categories: blog Tags: design software human error

I call some things ‘footguns’. What do I mean with that? A footgun is a gun that is designed to shoot yourself in the foot. I don’t know anything about guns, I have no use for them. But I’ve heard about this phrase and the idea stuck:

A footgun is a piece of code that is designed to do the wrong thing easily.

It is superhard to do the right, safe thing, and easy to do the wrong thing.

It is actually a case of bad design, and more often bad defaults.

a child shooting a water pistol

Examples:

So, when you do find footguns in your code, please please remove them and create a pit of success for your users:

Make it easy to do the right thing and make it hard to do the wrong thing.