RU version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
85% Positive
Analyzed from 939 words in the discussion.
Trending Topics
#code#free#something#fence#puppy#job#lines#things#llm#request

Discussion (21 Comments)Read Original on HackerNews
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.
This likely doesn’t correlate to code as much.
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.”.
> 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.
It started, by giving me a 2,500-line 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.
The LLM suggested a fix that didn’t work that well, and made the UI janky.
By now, the viewcontroller was over 4,000 lines.
I asked the LLM to refactor for redundancy and size.
It removed all the documentation and logging, reducing the size to about 2,500 lines.
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 code.
It’s currently about 1,400 lines (about 50% is documentation), and works great.
Lesson learned.
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.
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.
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.
Previously I wrote https://news.ycombinator.com/item?id=48517931
> 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
> 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