Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is a concept known as Chesterton's Fence - that you shouldn't take down a fence someone else put up until you know why they put it up, or more generally if you don't understand why something was previously considered a good solution to a problem, then it's possible you don't understand the problem it was meant to solve.


In my experience, so many things were _not_ a good solution to the problem but merely the first thing that looked like it worked. This leaves a trail of garbage behind which it's unclear if it's safe to remove or not, which is a huge cognitive overhead for someone trying to make changes later on.

If something is there that's not going to be obvious in 6 months time please please document/comment it. Stop building mysterious fences!


That's right, but the advice is targeted at you when somebody's already left you a mystery fence. They should have done better and documented it, but they didn't and now you have to deal with it.


Indeed, a comment in code that indicate that a choice was probably not optimal and it was done in hurry would help the next developer to not assume to much intention when reading this part of code.


Is this Chesterton's Garbage?


Chesterton's Roadside Picnic


I love this analogy.

Sometimes it's a perfectly good fence, sometimes it's an invisible spatial anomaly that turns people inside out.

¯\_(ツ)_/¯


In my experience extremely abstracted code with inconsistent naming schemes and general data confusion is a sign of bad code. Add meta programming (outside of well documented libraries with simple ergonomics) to that list.

In 20 years if it smells like duck it's because the duck was trying to shoehorn functional programming paradigms into ruby by abusing the hell out of blocks, bad clever code is just bad code.


I've never understood the analogy. Fences are built to keep people or other animals inside or outside an area, the purpose is almost always fully obvious. They are also not that cheap and require some upkeep, it is almost always easy to find the owner of a fence. I really don't know what sort of fence he had in mind.


The original quote mentions a fence or gate built across a road. Also Chesterton is writing from an English perspective which includes familiarity with manmade landscapes built up over thousands of years where the intentions of the original builders are lost to history. He probably had a dry stone wall in mind which are often used to fence in parcels of land. In any case, I’ll let him defend his position himself, his wit is as sharp as ever:

“In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be called a paradox. 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."

This paradox rests on the most elementary common sense. The gate or fence did not grow there. It was not set up by somnambulists who built it in their sleep. It is highly improbable that it was put there by escaped lunatics who were for some reason loose in the street. Some person had some reason for thinking it would be a good thing for somebody. And until we know what the reason was, we really cannot judge whether the reason was reasonable. It is extremely probable that we have overlooked some whole aspect of the question, if something set up by human beings like ourselves seems to be entirely meaningless and mysterious. There are reformers who get over this difficulty by assuming that all their fathers were fools; but if that be so, we can only say that folly appears to be a hereditary disease. But the truth is that nobody has any business to destroy a social institution until he has really seen it as an historical institution. If he knows how it arose, and what purposes it was supposed to serve, he may really be able to say that they were bad purposes, that they have since become bad purposes, or that they are purposes which are no longer served. But if he simply stares at the thing as a senseless monstrosity that has somehow sprung up in his path, it is he and not the traditionalist who is suffering from an illusion.”


The sort that controls perfectly spherical cattle?

I also don’t really like the fence analogy. A real fence typically exists to demarcate property lines and / or keep things in / out. This is usually perfectly obvious, even if you don’t know who the owner actually is, or the specific role.


That’s part of the point. It usually is obvious. So when it’s not immediately obvious, we should err on the side of caution rather than action.

Chesterton’s fence is another adage in the “try not to assume things” category.


Fences are boundaries. Code structure can be thought of as mostly a set of boundaries around knowledge domains.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: