Chesterton and the Fencepost

G.K. Chesterton once wrote about the hazard of removing a metaphorical fence simply because you see no need for it today. He cautioned that before you remove the fence, you should understand why it was there in the first place. This story has become part of programming lore, perhaps leading to an overabundance of caution when it comes to removing features.

The Original

There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up to it and says, "I don’t see the use of this; let us clear it away." To which the more intelligent type of reformer will do well to answer: "If you don’t see the use of it, I certainly won’t let you clear it away. Go away and think. Then, when you can come back and tell me that you do see the use of it, I may allow you to destroy it."

The Trap

The moral of this story is often taken to be that you are more likely to cause harm if you remove the fence without first understanding why it exists. This is a reasonable interpretation. When you first see the fence you think "this fence is in my way" or at the very least "this fence serves no purpose". So its existence is causing harm.

The interpretation that removing the fence is likely to cause more harm might even be provable using probabilities. Let's say the expected value of removing the fence is A and the expected value of keeping the fence is B. Initially we think A is greater than B, therefore we should remove the fence.

But if it turns out there was a good reason for the fence to exist, then A is actually less than B. If we find this out after removing the fence, now we have an added cost of replacing a fence. Clearly it would have been better to leave the fence there and avoid having to rebuild the stupid fence.

A software developer reads this story and absorbs the lesson. Later, they are on a deadline, trying to implement something complex while trying to appease conflicting requirements from different stakeholders. They see some feature that seems to serve no purpose, and the question arises - should we remove this feature? So they recall Chesterton's story about the fence, and find the immediate solution: keep the feature.

The danger of the story of Chesterton's fence is not that the advice is bad - on the contrary, the advice is solid. Rather, danger is that the advice leads to a heuristic that leads to not applying the advice in full.

A New Moral

The moral of this post is: the moral of the story of Chesterton's fence is not sufficient reason to avoid removing a feature, and it does not absolve you from investigating why the feature came to exist.