Live data from Hacker News

How to effectively write quality code with AI

heidenstedt.org

191–200 of 321 posts

Re: How to effectively write quality code with AI

#191

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.

so is the 10-20% in velocity worth the money and the process-complexity added? I'm assuming you're measuring your own velocity, not your team's, since that includes time to review and deploy etc.

Re: How to effectively write quality code with AI

#192

The post touches very briefly on linting in 7. For me, setting up a large number of static code analysis checks has had the highest impact on code quality. My hierarchy of static analysis looks like this (hierarchy below is Typescript focused but in principle translatable to other languages): 1. Typesafe compiler (tsc) 2. Basic lint rules (eslint) 3. Cyclomatic complexity rules (eslint, sonarjs) 4. Max line length en…

Very nice.

BUT, what is the point of max line length enforcement, just to see if there are crazy ternary operators going on?

Re: How to effectively write quality code with AI

#193
post #178

Earlier quoted context omitted.

I hear you. And maybe you're right. Maybe I'm deluding myself, but: when I look at my skilled colleagues who vibecode, I can't understand how this is sustainable. They're smart people, but they've clearly turned off. They can't answer non-trivial questions about the details of the stuff they (vibe-)delivered without asking the LLM that wrote it. Whoever uses the code downstream aren't gonna stand (or pay!) for this l…

I have this nagging feeling I’m more and more skimming text, not just what the LLMs output, but all type of texts. I’m afraid people will get too lazy to read, when the LLM is almost always right. Maybe it’s a silly thought. I hope!

This is my fear too.

People will say "oh, it's the same as when the printing press came, people were afraid we'd get lazy from not copying text by hand", or any of a myriad of other innovations that made our lives easier. I think this time it's different though, because we're talking about offloading the very essence of humanity – thinking. Sure, getting too lazy to walk after cars became widespread was detrimental to our health, but if we get too lazy to think, what are we?

Re: How to effectively write quality code with AI

#194

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.

[deleted]

Re: How to effectively write quality code with AI

#195
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…

Not everyone works in aerospace engineering, though.

I would guess that >90% of all web crud can already be done better by an LLM managed by a decent developer, than purely by the developer himself.

Re: How to effectively write quality code with AI

#196
post #178

Earlier quoted context omitted.

I hear you. And maybe you're right. Maybe I'm deluding myself, but: when I look at my skilled colleagues who vibecode, I can't understand how this is sustainable. They're smart people, but they've clearly turned off. They can't answer non-trivial questions about the details of the stuff they (vibe-)delivered without asking the LLM that wrote it. Whoever uses the code downstream aren't gonna stand (or pay!) for this l…

I have this nagging feeling I’m more and more skimming text, not just what the LLMs output, but all type of texts. I’m afraid people will get too lazy to read, when the LLM is almost always right. Maybe it’s a silly thought. I hope!

there are some youtube videos about the topic, be it pupil in high school addicted to llms, or adults losing skills, and not dev only, society is starting to see strange effects

Re: How to effectively write quality code with AI

#197

Earlier quoted context omitted.

Underground Resistance Aims To Sabotage AI With Poisoned Data https://news.ycombinator.com/item?id=46827777

Textile workers sabotage mechanical looms. History repeats itself.

What do we want? Meaningless preventable toil! When do we want it? Now!

Re: How to effectively write quality code with AI

#198

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.

I liken it to manual versus automated industrial production. I think manual coding will always have its place just like how there are even still people who craft things by manual labor, whether it’s woodworkers only using manual tools or blacksmiths who still manually stoke coke fires that produce very unique and custom products; vs the highly automated production lines we have that produce acceptable forms of something efficiently, and many of them so many people can have them.

Re: How to effectively write quality code with AI

#199

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.

I think of it differently: I’ve been coding so long that ironing out the details and working through the specification with AI comes extremely naturally. It’s like how I would talk to a colleague and iterate on their work. However, the quality of the code produced by LLMs needs to be carefully managed to assure it’s of a high standard. That’s why I formalized a system of checks and balances for my genetic coding that contains architectural guidelines as well as language, specific taste advice.

You can check it out here: https://ai-lint.dosaygo.com/

Re: How to effectively write quality code with AI

#200

Earlier quoted context omitted.

Where is all the amazing software and/or improvements in software quality that is supposed to be coming from this revolution? So far the only output is the "How I use AI blogs", AI marketing blogs, more CVEs, more outages, degraded software quality, and not much of shipping anything. Is there any examples of real products and not just anecdotes of "I'm 10x more productive!"?

Sounds like a skill issue. I’ve seen it rapidly increase the speed of delivery in my shop.

Why is it so hard to find examples?
Post reply on HN