From Chesterton's fence to Chesterton's gap

(stephantul.github.io)

47 points | by stephantul 8 hours ago ago

35 comments

  • jerf 13 minutes ago

    "I can also write lines of code for free. I have the same superpowers you do..."

    Boy oh boy can I tell that people have still not internalized this. Yes, your HTTP proxy with a list of features as long as my arm would have been impressive 5 years ago, at least on some level. Today, I can prompt it into existence as easily as you did, and if I am prompting it into existence I can build a custom one with just the features I need, that integrates into my logging & metrics, etc., and perhaps most importantly, I can literally do that more quickly than I can evaluate your project. AI has eliminated the space of open source projects where evaluation of your project takes longer than prompting it into existence does for me.

    • notarobot123 4 minutes ago

      [delayed]

    • rpdillon 11 minutes ago

      The premise of this argument is that using AI takes no skill, and experience using AI doesn't matter, and that domain expertise in software development won't help you build better software with AI.

      I don't think any of those things are true.

  • kps 11 minutes ago

    Whoever built the fence should have put a sign on it saying why.

    Oh, and integration tests to check that the problem doesn't recur when the fence is replaced.

    • tshaddox 7 minutes ago

      Advocates of Chesterton’s Fence tend to miss that they’re applying selective pressure to favor systems that don’t document (or outright obscure) their purpose.

      Of course, the much more obvious flaw of Chesterton’s Fence is that it trivially reduces to status quo bias.

  • ChrisMarshallNY 4 hours ago

    I’ve found utility in removing code.

    I feel that doing the job with the fewest lines of code, is best.

    I also believe in focused/pure scope. If I write a type or API to do a job, then it should do that job, and only that job. If I want to add functionality that is out-of-scope, then I’ll often write another type, instead of adding it to the existing one. Making this type of decision is always fraught.

    But, like in all things, it depends. Sometimes, reducing the overhead of things like setup and testing is a good reason to not introduce a whole new resource, but I should make it a point to document the reason for the incongruity.

    This is especially true, when designing user interface. I’ve found that, usually (not all the time, though), less is more.

    Josef Albers is known (amongst other things), for the quote “Sometimes, in design, one plus one is three or more.”.

    • fransje26 3 hours ago

      > I’ve found utility in removing code.

      > I feel that doing the job with the fewest lines of code, is best.

      And that is one of my gripes with AI models and code. They are so, so verbose. It's a nightmare.

      "Why don't you let AI implement that small feature, it will be faster.", they would ask.

      Well, because if do, it will completely pollute my carefully crafted interface that I kept small, simple and understandable for easier maintenance and extension.

      And yes, I might spare a few hours by having _it_ work for me. But then I need to spend a more hours to clean-up the code noise and complexification.

      Sorry for having polluted the conversation by bringing AI in, when for once, ironically, it was not about AI.. I needed to vent, while fully approving of your take.

      • ChrisMarshallNY 2 hours ago

        I just had to rewrite a screen written by an LLM.

        It started, by giving me a 2,500-line (about 50% documentation) viewcontroller that ate so much memory that the app would jetsam after the user just did a couple of things.

        I then, spent about a week, tracking down memory issues, until we narrowed it down to the MapKit cache. All this time, the LLM was making the code scarier and scarier. It was exactly what I would expect from an inexperienced (but smart) engineer, panicking, and adding more and more cruft.

        The LLM ended up suggesting fixes that didn’t work that well, and made the UI janky. Also, it was terrifyingly delicate. I don't think it would have survived one feature request.

        By now, the viewcontroller was over 4,000 lines.

        I asked the LLM to refactor for redundancy, quality, and size.

        It removed all the documentation and logging, reducing the size back to about 2,500 lines (about 1% documentation).

        Yay.

        Except all of the bush-league threading and awful workaround shit was still in there, but now impossible to understand.

        At this point, I gave up, threw out the LLM code, and rewrote the viewcontroller from scratch. Took a day and a half. I figured out how to force MapKit to flush its cache (2 lines of code). It's a well-known issue, and the solution was the first StackOverflow answer that showed up in the search.

        It’s currently about 1,400 lines (about 50% is documentation), and works great.

        Lesson learned.

        • fransje26 38 minutes ago

          > It removed all the documentation and logging, reducing the size to about 2,500 lines. [..] but now impossible to understand.

          Nice. Lol.

          > At this point, I gave up, threw out the LLM code, and rewrote the code. It’s currently about 1,400 lines (about 50% is documentation), and works great.

          I've had similar experiences. But I must be "holding it wrong", judging by all the other articles on HN..

      • trollbridge 2 hours ago

        I evaluate how good models are now by how good they are at removing code.

        It’s fairly simple (assuming the test harness and agents.md are well written): do iterations of trying to remove code, ensure it passes, then have a human review it. Less code to review that way.

  • JKCalhoun 3 hours ago

    Something I'll call Milito's Meadow [1]. Start with a clean slate. Everything goes: fences, farmhouses, roads… Down to the bare earth.

    Then build up again from scratch. Likely you will in fact put a fence here or there—but of course you'll know with certainty why it is there. (And more times than not, there will be fewer fences when you are done.)

    [1] Naming this for a friend who taught me about fence razing.

    • quietbritishjim an hour ago

      This is addressed by the classic article by Joel on Software (which is apt, as it's a classic mistake):

      https://www.joelonsoftware.com/2000/04/06/things-you-should-...

      To rephrase in the language of this conversation, he answers: why are there all those fences there?

      > I’ll tell you why: those are bug fixes. One of them fixes that bug that Nancy had when she tried to install the thing on a computer that didn’t have Internet Explorer. Another one fixes that bug that occurs in low memory conditions. Another one fixes that bug that occurred when the file is on a floppy disk and the user yanks out the disk in the middle. That LoadLibrary call is ugly but it makes the code work on old versions of Windows 95.

      (Yes the references are a bit out of date. The article is from over 25 years ago!)

      • tshaddox 5 minutes ago

        Haven’t there been successful rewrites of nontrivial applications? I’ve always been skeptical of Joel’s Netscape example. Was the rewrite really the mistake? Couldn’t the mistake have been making an application where no one knows how it’s supposed to behave?

      • BoxFour 16 minutes ago

        Actually, I think the old references are relevant. Sometimes those bug fixes and workarounds no longer matter. Windows 95 and Internet Explorer are long gone, we don’t need to architect our code base any longer to support them, but everyone’s petrified to remove the support for them.

        Or in the language of fences, the fence might’ve been built for a herd of cattle that no longer exists. Raze away!

    • bombcar 3 hours ago

      A ground-up rebuild can be wonderful, but something is lost in those US plaster-planned cities that attempt to imitate Florence or other EU cities; something about organic growth that is very hard to replicate ex-nihilo.

      This likely doesn’t correlate to code as much.

    • asplake an hour ago

      Reminds me of Ackoff’s Idealised Design [1]

      [1] https://en.wikipedia.org/wiki/Interactive_planning#Idealized...

    • cwmoore an hour ago

      Unfortunately, before the fences are down you are in jail, and with you, it stays where it was.

    • stephantul 3 hours ago

      Extreme programming in a nutshell. I like doing this to features: build it, then take it down and rebuild but better.

      • jpitz an hour ago

        "Plan to throw one away. You will anyway."

    • simondw an hour ago

      Sounds like a very expensive and time-consuming way to build something that won't work very well for a while. Is that the point?

  • ndr 5 hours ago

    Related to this, the concept of "free as in puppies" from D. Richard Hipp, creator of SQLite:

    > Suppose you had a pull request for SQLite. "Hey, I've got this new feature for SQLite. Here's the pull request." When you want me to pull that into the tree, you say, "Oh, it's free."

    > No, it's not free. What you're doing is asking me - you've got this cool feature, and you want me to maintain it for you, to document it for you, to test it for you, to maintain it for you for the next twenty-five years. That's not free.

    > Linus Torvalds is famous for saying there's free as in beer and free as in speech. But there's another kind of freedom: free as in puppies. "Oh look, I've got a free puppy for you." You see where this is going?

    > A pull request is a free puppy. And then you've just got a kennel full of puppies at the end of the day. And you can't just throw them out - you're morally obligated to take care of them for their natural life.

    > I don't want any free puppies.

    source: https://youtu.be/x8_ZZhRL3YU?t=1715

    • stephantul 5 hours ago

      Thanks! This is very similar indeed. Related: I see a lot of “drive-by” PRs by agents, who obviously have no intent of ever maintaining the code they wrote.

      • api 3 hours ago

        Puppy cannons. Puppy carpet bombing.

        • ChrisMarshallNY 3 hours ago

          A new definition of "puppy mill."

        • stephantul 3 hours ago

          Puppy slush automatically pushed through vents into your codebase

    • akoboldfrying 5 hours ago

      FYI there are quite a few glitches in there:

      > and want you want me to maintain it for you

      > to to document it for you

      > Linus Torvalds is famous famous

      > A pool request

      > They're you you're you're morally obligated

      • ndr 4 hours ago

        Thank you, I was too eager copy-pasting YT transcriptions.

        • trollbridge 2 hours ago

          It’s refreshing to read something not run though an LLM to make it look plausible first.

  • cainxinth 3 hours ago

    I wouldn’t have thought that black text on a lavender background would make for pleasing reading, but it was actually quite nice.

    • jakzurr 2 hours ago

      I probably would have agreed 50 years ago, but it's a bit hard now. Fortunately, select-all boosted the contrast nicely. ;)

    • stephantul 2 hours ago

      Ha thanks, it was pink a while ago

  • joshka 6 hours ago

    The counterpoint is that building software is not building a fence. When you create something in software, nothing tangible changes until that's accepted and running on all the places that you deploy to. A PR is just a hey, here's a fence that the contributor built elsewhere that proves that building something like this is possible.

    The corollary is design your open source libraries so they're obvious enough that the chesterton's gaps are obvious. Anytime an AI tool submits something that breaks your expectation of things not being necessary it usually highlights that there's a missing gap in the explanation of what is necessary.

    • stephantul 5 hours ago

      I’m not sure I share your view of PRs. I still see submitting PRs as something that puts pressure on maintainers. Even incorrect PRs take time to verify and review.

      I also don’t see how this differs between the “gap” and the “fence” part of the metaphor. Whether someone submits a rewrite/removal (fence) or a new feature (gap) for PR review, it’s still going to cost me attention.

      • joshka 4 hours ago

        It's only pressure if you believe the social contract in a PR is that everything that is written is something you're obligated to read / respond to. If you flip that a bit to a PR being the first step in a way of saying "I tried a thing and it worked, what's necessary to make that an actual thing that other can use", then you will sort of land here.

        Previously I wrote https://news.ycombinator.com/item?id=48517931

        • wnoise 2 hours ago

          Saying your quoted words is a request for someone to read and respond; it's still pressure and a burden.