Live data from Hacker News

How to effectively write quality code with AI

heidenstedt.org

151–160 of 321 posts

Re: How to effectively write quality code with AI

#151

Earlier quoted context omitted.

I second this. This* is the matter against which we form understanding. This here is the work at hand, our own notes, discussions we have with people, the silent walk where our brain kinda process errors and ideas .. it's always been like this since i was a kid, playing with construction toys. I never ever wanted somebody to play while I wait to evaluate if it fits my desires. Desires that often come from playing. Ou…

I wonder over the long term how programmers are going to maintain the proficiency to read and edit the code that the LLM produces.

I don’t read or edit the code my claude code agent produces. That’s its job now. My job is to organize the process and get things done.

Re: How to effectively write quality code with AI

#152
post #35

Sounds like an awful lot of work and nannying just to avoid writing code yourself. Coding used to be fun and enjoyable once...

A good bit of scaffolding and babysitting allows you to let the model run much faster and more efficiently. Building your tool faster. I don't code to code, I code to build something I want.

Re: How to effectively write quality code with AI

#153
post #112

Earlier quoted context omitted.

My setup has some of the things mentioned and I found that occasionally the LLM will lie that something passes, when it doesn't.

Yup I have run into the same. I use a pre-commit hook to run `pnpm check`. I missed mentioning it in the original comment. Your reply reminded me of it and I have now added it. Thanks.

That's something I find to be incredibly frustrating. I have to keep reminding it that we're not done, no matter how much I enforce that the lints must pass before we're done.

Re: How to effectively write quality code with AI

#154

I use it for scaffolding and often correct it for the layour I prefer. Then I use to check my code, and then scaffold in some more modules. I then connect them together. Long as you review the code and correct it, it is no more different than using stackoverflow. A stack overflow that reads your code and helps stitch the context.

"Stack Overflow that reads your codebase" — perfect. But Stack Overflow is stateless. Agent sessions aren't.

One session's scaffold assumes one pattern. Second session scaffold contradicts it. You reviewed both in isolation. Both looked fine. Neither knows about the other.

Reviewing AI code per-session is like proofreading individual chapters of a novel nobody's reading front to back. Each chapter is fine. The plot makes no sense.

Re: How to effectively write quality code with AI

#155
post #96

Earlier quoted context omitted.

> I think you have every right to doubt those telling us that they run 5 agents to generate a new SAAS-product while they are sipping latté in a bar. To work like that I believe you'll have to let go of really digging into the code, which in my experience is needed if want good quality. Also we live in a capitalist society. The boss will soon ask: "Why the fuck am I paying you to sip a latte in a bar? While am machin…

> AI just means more output will be expected of you, and they'll keep pushing you to work as hard as you can. That’s a bit too cynical for me. After all, yes, your boss is not paying you for sipping lattes, but for producing value for the company. If there is a tool that maximises your output, why wouldn’t he want you to use that to great efficiency? Put differently, would a carpenter shop accept employees rejecting…

> why wouldn’t he want you to use that to great efficiency

Because I deny that? It's not fun for me.

> would a carpenter shop accept employees rejecting the power saw in favour of a hand saw to retain their artisanal capability?

Why not? If that makes enough money to keep going.

You might argue that in theoretical ideal market companies who're not utilizing every possible trick to improve productivity (including AI) will lose competition, but let's be real, a lot of companies are horribly inefficient and that does not make them bankrupt. The world of producing software is complicated.

I know that I deliver. When I'm asked to write a code, I deliver it and I responsible for it. I enjoy the process and I can support this code. I can't deliver with AI. I don't know what it'll generate. I don't know how much time would it take to iterate to the result that I precisely want. So I can't longer be responsible for my own output. Or I'd spend more time baby-sitting AI than it would take me to write the code. That's my position. Maybe I'm wrong, they'll fire me and I'll retire, who knows. AI hype is real and my boss often copy&pasting ChatGPT asking me to argue with it. That's super stupid and irritating.

Re: How to effectively write quality code with AI

#156
In general, I prefer to do the top-level design and the big abstractions myself. I care a lot about cohesion and coupling; I like to give a lot of thought to my interfaces.

And in practice, I am happy enough that the LLM helps me to eliminate some toil, but I think you need to know when it is time to fold your cards, and leave the game. I prefer to fix small bugs in the generated code myself, than asking the agent, as it tends to go too far when fixing its own code.

Re: How to effectively write quality code with AI

#157

Earlier quoted context omitted.

I second this. This* is the matter against which we form understanding. This here is the work at hand, our own notes, discussions we have with people, the silent walk where our brain kinda process errors and ideas .. it's always been like this since i was a kid, playing with construction toys. I never ever wanted somebody to play while I wait to evaluate if it fits my desires. Desires that often come from playing. Ou…

I wonder over the long term how programmers are going to maintain the proficiency to read and edit the code that the LLM produces.

There were always many mediocre engineers around, some of them even with fancy titles like "Senior," "Principal", and CTO.

We have always survived it, so probably we can also survive mediocre coders not reading the code the LLM generates for them because they are unable to see the problems that they were never able to see in their handwritten code.

Re: How to effectively write quality code with AI

#158
Ironically, I use the time saved using agents to read technical books ferociously.

Coding agents made me really get something back from the money I pay for my O'Reilly subscription.

So, coding agents are making me a better engineer by giving me time to dive deeper into books instead of having to just read enough to do something that works under time pressure.

Re: How to effectively write quality code with AI

#159
post #36

Earlier quoted context omitted.

That's also how I feel. I think you have every right to doubt those telling us that they run 5 agents to generate a new SAAS-product while they are sipping latté in a bar. To work like that I believe you'll have to let go of really digging into the code, which in my experience is needed if want good quality. Yet I think coding agents can be quite a useful help for some of the trivial, but time consuming chores. For i…

I think we really need to have a serious think of what is "good quality" in the age of coding agents. A lot of the effort we put into maintaining quality has to do with maintainability, readability etc. But is it relevant if the code isn't for humans? What is good for a human is not what is good for an AI necessarily (not to say there is no overlap). I think there are clearly measurable things we can agree still appl…

This is where I think its going, it feels that in the end we will end up with an "llm" language, one that is more suited to how an llm works and less human.

Re: How to effectively write quality code with AI

#160

I wonder at the end of this if it's the still worth the risk? A lot of how I form my thoughts is driven by writing code, and seeing it on screen, running into its limitations. Maybe it's the kind of work I'm doing, or maybe I just suck, but the code to me is a forcing mechanism into ironing out the details, and I don't get that when I'm writing a specification.

> A lot of how I form my thoughts is driven by writing code, and seeing it on screen, running into its limitations. Two principles I have held for many years which I believe are relevant both to your sentiment and this thread are reproduced below. Hopefully they help. First: When making software, remember that it is a snapshot of your understanding of the problem. It states to all, including your future-self, your ap…

To your first point - so are my many markdown files that I tell Codex/Claude to keep updated while I’m doing my work including telling them to keep them updated with why I told them to do certain things. They have detailed documentation of my initial design goals and decisions that I wrote myself.

Actually those same markdown files answer the second question.

Post reply on HN