Live data from Hacker News

How to effectively write quality code with AI

heidenstedt.org

91–100 of 321 posts

Re: How to effectively write quality code with AI

#91
post #82

Earlier quoted context omitted.

Are there still people under the impression that the correct way to use Stack Overflow all these years was to copy & paste without analyzing what the code did and making it fit for purpose? If I have to say, we're just waiting for the AI concern caucus to get tired of performing for each other and justifying each other's inaction in other facets of their lives.

Lab-grown meat slop producer defends AI slop.

So now we're pro-slaughter and low-yield agriculture as long as we get to ride the keyboard eh?

Re: How to effectively write quality code with AI

#92

My tricks: Define data structures manually, ask AI to implement specific state changes. So JSON, C .h or other source files of func sigs and put prompts in there. Never tried the Agents.md monolithic definition file approach Also I demand it stick to a limited set of processing patterns. Usually dynamic, recursive programming techniques and functions. They just make the most sense to my head and using one style I can…

small agents.md files are worth it, at least for holding some basic information (look at build.md to read how to build, the file structure looks like so), rather than have whatever burn double the amount of tokens searching for whatever anyways.

Re: How to effectively write quality code with AI

#93

My approach: 1. Have the LLM write code based on a clear prompt with limited scope 2. Look at the diff and fix everything it got wrong That's it. I don't gain a lot in velocity, maybe 10-20%, but I've seen the code, and I know it's good.

Same. Small units if work, iterate in it till it's right, commit it, push it, then do the next increment of work. It's how I've always worked like that, except now, I sometimes let someone else figure the exact API calls (I'm still learning react, but Claude helps get the basics in place for me). If the AI just keeps screwing up, I'll grab the wheel and do it myself. It sometimes helps me get things going, but it hasn't been a huge increase in productivity, but I'm not paying the bill so whatever.

Re: How to effectively write quality code with AI

#94
post #80

Earlier quoted context omitted.

So like we went from assembler to higher level programming languages, we will now move to specifications for LLMs? Interesting thought... Maybe, once the "compilers" get good enough, but for mission critical systems they are not nearly good enough yet.

Right. I work in aerospace software, and I do not know if this option would ever be on the table. It certainly isn't now. So I think this question needs to be asked in the context of particular projects, not as an industry-wide yes or no answer. Does your particular project still need humans involved at the code level? Even just for review? If so, then you probably ought to retain human-oriented software design and c…

Then again, would anyone have guessed we’d even be seriously discussing this topic 10, 20, 40 years ago?

Re: How to effectively write quality code with AI

#95

Earlier quoted context omitted.

Oh I'm well aware of this. I admitted defeat in a way.. I can't compete. I'm just at loss, and unless LLM stall and break for some reason (ai bubble, enshittification..) I don't see a future for me in "software" in a few years.

Somehow I appreciate this type of attitude more than the one which reflects total denial of the current trajectory. Fervent denial and AI trash-talking being maybe the single most dominant sentiment on HN over the last year, by all means interspersed with a fair amount of amazement at our new toys. But it is sad if good programmers should loose sight of the opportunities the future will bring (future as in the next f…

I get crazy over the 'engineer are not paid to write loc', nobody is sad because they don't have to type anymore. My two issues are it levels the delivery game, for the average web app, anybody can now output something acceptable, and then it doesn't help me conceptualize solution better, so I revert to letting it produce stuff that is not maleable enough.

Re: How to effectively write quality code with AI

#96

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 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 the power saw in favour of a hand saw to retain their artisanal capability?

Re: How to effectively write quality code with AI

#97
post #94
post #80

Earlier quoted context omitted.

Right. I work in aerospace software, and I do not know if this option would ever be on the table. It certainly isn't now. So I think this question needs to be asked in the context of particular projects, not as an industry-wide yes or no answer. Does your particular project still need humans involved at the code level? Even just for review? If so, then you probably ought to retain human-oriented software design and c…

Then again, would anyone have guessed we’d even be seriously discussing this topic 10, 20, 40 years ago?

Maybe. This book from 1990

https://mitpress.mit.edu/9780262526401/artificial-intelligen...

envisions a future of AI assistance that looks not too far off from today.

Re: How to effectively write quality code with AI

#98

I can't help but keep finding it ridiculous how everyone now discovers basic best practices (linting, documentation, small incremental changes) that have been known for ages. It's not needed because of AI, you should have been doing it like this before as well.

Anyone who’s been a developer for more than 10 minutes knows that best practices are hard to always follow through on when there’s pressure to ship.

But there’s more time to do some of these other things if the actual coding time is trending toward zero.

And the importance of it can go up with AI systems because they do actually use the documentation you write as part of their context! Direct visible value can lead people to finally take more seriously things that previously felt like luxuries they didn’t have time for.

Again if you’ve been a developer for more than 10 minutes, you’ve had the discouraging experience of pain-stakingly writing very good documentation only for it to be ignored by the next guy. This isn’t how LLMs work. They read your docs.

Re: How to effectively write quality code with AI

#99

Earlier quoted context omitted.

Oh I'm well aware of this. I admitted defeat in a way.. I can't compete. I'm just at loss, and unless LLM stall and break for some reason (ai bubble, enshittification..) I don't see a future for me in "software" in a few years.

Somehow I appreciate this type of attitude more than the one which reflects total denial of the current trajectory. Fervent denial and AI trash-talking being maybe the single most dominant sentiment on HN over the last year, by all means interspersed with a fair amount of amazement at our new toys. But it is sad if good programmers should loose sight of the opportunities the future will bring (future as in the next f…

If the world comes to that it will be absolutely catastrophic, and it’s a failure of grappling with the implications that many of the executives of AI companies think you can paper over the social upheaval with some UBI. There will be no controlling what happens, and you don’t even need to believe in some malicious autonomous AI to see that.
Post reply on HN