Member-only story
Before You Remove or Change Code, Think of Chesterton’s Fence
When you don’t understand the purpose of something, think before action
“A great many people think they are thinking when they are merely rearranging their prejudices.” — William James
Whenever a developer changes code, their change could fix one part and break another. The difficulty in changing code is understanding its purpose and the requirements behind its creation.
If the code exists, there is likely a reason for it.
To remove or change code, you first need to understand why a developer created it. It’s difficult to find the purpose of the code because even requirements are updated and become dated.
All code you see was added for a reason, what was the reason, and is it still valid?
Chesterton’s fence
“Don’t ever take a fence down until you know the reason it was put up.” ― G. K. Chesterton
I read about Chesterton’s fence from Farnam street — Chesterton’s Fence. G. K. Chesterton was an England writer who wrote around 80 books and 4000 essays and liked to use proverbs, allegories, and any other tool to make his point. His most famous story is a The Man Who Was Thursday.

In one of his books, he discussed a fence and its purpose, the two quotes below:
“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…