Live data from Hacker News

How to effectively write quality code with AI

heidenstedt.org

161–170 of 321 posts

Re: How to effectively write quality code with AI

#161

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…

My think/create/solve focus is on making my agentic coding environment produce high quality code with the least cost. Seems like a technical challenge worth playing with.

It probably helps that I have 40 years of experience with producing code the old ways, including using punch cards in middle school and learning basic on a computer with no persistent storage when I was ten.

I think I've done enough time in the trenches and deserve to play with coding agents without shame.

Re: How to effectively write quality code with AI

#163

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

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

Re: How to effectively write quality code with AI

#164

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.

Honestly it’s not that hard. I already coded less and less as part of my job as I get more senior and just didn’t have time, but I was still easy to do code reviews and fix bugs, sit down and whip out a thousand lines in a power session. Once you learn it doesn’t take much practice to maintain it. A lot of traditional coding is very inefficient. With AI it’s like we’re moving from combustion cars to EVs, the energy efficiency is night and day, for doing the same thing.

That said, the next generation may struggle, but they’ll find their way.

Re: How to effectively write quality code with AI

#165
post #47

Earlier quoted context omitted.

> But it's also likely that these tools will produce mountains of unmaintainable code and people will get buried by the technical debt. It's not just likely, but it's guaranteed to happen if you're not keeping an eye on it. So much so, that it's really reinforced my existing prejudice towards typed and compiled languages to reduce some of the checking you need to do. Using an agent with a dynamic language feels very…

Companies aren't evaluating on "keeping an eye on technical debt", but then ARE directly evaluating on whether you use AI tools. Meanwhile they are hollowing out work forces based on those metrics. If we make doing the right thing career limiting this all gets rather messy rather quickly.

> If we make doing the right thing career limiting this all gets rather messy rather quickly.

This has already happened. The gold rush brogrammers have taken over.

Careers are over. Company loyalty is a relic. Now it's a matter of adapting quickly to earn enough to survive.

Re: How to effectively write quality code with AI

#166

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…

Except for dependency cruiser which I hadn't heard of, this is almost exactly what I've built up over the past few weeks.

For the pre-commit hook, I assume you run it on just the files changed?

> Custom script to ensure shared/util directories are not over stuffed (built this using dependency-cruiser as a library rather than an exec)

Would you share this?

Re: How to effectively write quality code with AI

#167
post #112

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…

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

Make the error message much more dramatic and it will be less likely to miss it. Create a wrapper if you can't change the error message.

Remember these are still fundamentally trained on human communication and Dale Carnegie had some good advice that also applies to language generators.

Re: How to effectively write quality code with AI

#168
post #121
post #81

Earlier quoted context omitted.

> I see people at work who are drooling about being able to have code made for them .. but I'm not in that group. people seem to have a inability to predict second and third order effects the first order effect is "I can sip a latte while the bot does my job for me"... well, great I suppose, while it lasts but the second order effect is: unless you're in the top 10%, you will now lose your job, permanently and the th…

Alternatively, another second order effect is can't sip latte anymore because you're orchestrating 8 bots do the work and you're back to 80%-100% time saturation.

The previous second order effect is more likely. For the one orchestrating 8 bots, 7 others are not needed anymore.

Re: How to effectively write quality code with AI

#169
post #114

Earlier quoted context omitted.

If the power saw ran itself without any oversight, the carpenter shop wouldn't accept any type of employees.

But that’s the exact opposite of what the GP was arguing; you will be expected to stick with the agent more, not less.

You or someone else might be expected. The rest will just be expected to be fired.

Re: How to effectively write quality code with AI

#170

Earlier quoted context omitted.

Man, you are really missing out of the biggest revolution of my life. This is the opinion of someone who has not tried to use Claude Code, in a brand new project with full permissions enabled, and with a model from the last 3 months.

People have been saying "the models from (recent timeframe) are so much better than the old ones, they solve all the problems" for years now. Since GPT-4 if not earlier. Every single time , those goalposts have shifted as soon as the next model came out. With such an abysmal track record, it's not reasonable to expect people to believe that this time the tool actually has become good and that it's not just hype.

When is the last time someone said that, motivating you to try the latest model? If it was 6 or more month ago, my reply is that the sentiment expressed was partially incorrect in the past, but it is not incorrect now. If a conspiracy theorist is always wrong about a senior citizen being killed, that does not make the senior immortal.
Post reply on HN