Live data from Hacker News

How to effectively write quality code with AI

heidenstedt.org

231–240 of 321 posts

Re: How to effectively write quality code with AI

#231

Earlier quoted context omitted.

This is a fading but common sentiment on hacker news. There’s a lot of engineers who will refuse to wake up to the revolution happening in front of them. I get it. The denialism is a deeply human response.

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!"?

I was in the same mindset until I actually took the Claude code course they offer. I was doing so much wrong.

The two main takeaways. Create a CLAUDE.md file that defines everything about the project. Have Claude feed back into the file when it makes mistakes and how to fix them.

Now it creates well structured code and production level applications. I still double check everything of course, but the level of errors is much lower.

An example application it created from a CLAUDE.md I wrote. The application reads multiple PDF's, finds the key stakeholders and related data, then generates a network graph across those files and renders it in an explorable graph in Godot.

That took 3 hours to make, test. It also supports OpenAI (lmstudio), Claude and Ollama for its LLM callouts.

What issue I can see happening is the duplication of assets in work. Instead of finding an asset someone built, people have been creating their own.

Re: How to effectively write quality code with AI

#232

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 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 see people at work who are drooling about being able to have code made for them

These people just drool at being able to have work done for them to begin with. Are you sure it is just "code"?

Re: How to effectively write quality code with AI

#233
post #226

Earlier quoted context omitted.

Do you mean, from your perspective, within 2 years humans won’t be able to bring anything of value to the equation in management and control ?

No, I mean that my job in its current form – as an ML researcher with a phd and 15 years of experience - will be completely automated within two years.

If you want a machine (or in fact another human) to do something for you, there are two tasks you cannot delegate to them:

a) Specify what you want them to do.

b) Check if the result meets your expectations.

Does your current job include neither a nor b?

Re: How to effectively write quality code with AI

#234
I'd add:

Religiously, routinely refactor. After almost every feature I do a feature level code analysis and refactoring, and every few features - codebase wide code analysis and refactoring.

I am quite happy with the resulting code - much less shameful than most things I've created in 40 years of being passionate about coding.

Re: How to effectively write quality code with AI

#235
post #226

Earlier quoted context omitted.

No, I mean that my job in its current form – as an ML researcher with a phd and 15 years of experience - will be completely automated within two years.

If you want a machine (or in fact another human) to do something for you, there are two tasks you cannot delegate to them: a) Specify what you want them to do. b) Check if the result meets your expectations. Does your current job include neither a nor b?

A/B happen at different abstractions levels. My abstraction level will be automated. My manager’s level will probably last another year or so.

Re: How to effectively write quality code with AI

#237

I don’t understand the interest in “quality code.” I never need to look at the code itself. I just make sure it runs right.

It makes it easier to make sure it runs right. Code that is easier to make sure is quality code. Code that is hard to make sure is not quality code.

Re: How to effectively write quality code with AI

#238

Earlier quoted context omitted.

Textile workers sabotage mechanical looms. History repeats itself.

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

Nobody wants meaningless preventable toil. What people want is a living. Nobody would be afraid of AI taking their jobs if it didn’t mean that they’d get fired.

Re: How to effectively write quality code with AI

#239
post #235

Earlier quoted context omitted.

If you want a machine (or in fact another human) to do something for you, there are two tasks you cannot delegate to them: a) Specify what you want them to do. b) Check if the result meets your expectations. Does your current job include neither a nor b?

A/B happen at different abstractions levels. My abstraction level will be automated. My manager’s level will probably last another year or so.

So your assumption is that it will ultimately be the users of software themselves who will throw some every day language at an AI and it will reliably generate something that meets those users' intuitive expectations?

Re: How to effectively write quality code with AI

#240

Earlier quoted context omitted.

Ofc people are non deterministic. But usually we expect machines to be. That’s why we trust them blindly and don’t check the calculations. We review people’s work all the time though. Here people will stop review machine LLM code as it’s kind of a source of truth like in other areas. That’s my point, reviewing code takes time and even more time when no human wrote it. It’s a dangerous path to stop reviews because of…

No one who has any knowledge or who has ever used an LLM expects determinism. And there are no computer professionals who haven’t heard about hallucinations. Reviewing whether the code meets requirements through manual and automated tests - and that’s all I cared about when I had a team of 8 under me - is the same regardless. I wasn’t checking whether John used a for loop or while loop in between my customer meetings…

There are so many types of requirements though. Security is one, performance is another. No one has cared about while/for for a long time.
Post reply on HN