frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
69•i5heu•2h ago

Comments

OptionOfT•1h ago
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.

discreteevent•1h ago
Exactly. 30 years ago a mathematician I knew said to me: "The one thing that you can say for programming is that it forces you to be precise."

We vibe around a lot in our heads and that's great. But it's really refreshing, every so often, to be where the rubber meets the road.

shinryuu•1h ago
I couldn't agree more. It's often when you are in the depth of the details that I make important decisions on how to engineer the continuation.
jofla_net•1h ago
Yes, I look at this in a similar vein to the (Eval <--> Appply) Cycle in SICP textbook, as a (Design <--> Implement) cycle.
tayo42•1h ago
I was just thinking this the other day after I did a coding screen and didn't do well. I know the script for the interviewee is your not suppsed to write any code until you talk through the whole thing, but I think i woukd have done better if I could have just wrote a bunch of throw away code to iterate on.
jeppester•1h ago
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 instance I find them quite good at writing tests. I still have to tweak the tests and make sure that they do as they say, but overall the process is faster IMO.

They are also quite good at brute-forcing some issue with a certain configuration in a dark corner of your android manifest. Just know that they WILL find a solution even if there is none, so keep them on a leash!

Today I used Claude for bringing a project I abandoned 5 years ago up to speed. It's still at work in progress, but the task seemed insurmountable (in my limited spare time) without AI, now it feels like I'm half-way there in 2-3 hours.

frankc•36m ago
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 apply around bugs, security etc, but I think there are also going to be some things we need to just let go of.
skydhash•4m ago
You can’t drop anything as long as a programmer is expected to edit the source code directly. Good luck investigating a bug when the code is unclear semantically, or updating a piece correctly when you’re not really sure it’s the only instance.
agumonkey•1h ago
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.

Outsourcing this to an LLM is similar to an airplane stall .. I just dip mentally. The stress goes away too, since I assume the LLM will get rid of the "problem" but I have no more incentives to think, create, solve anything.

Still blows my mind how different people approach some fields. I see people at work who are drooling about being able to have code made for them .. but I'm not in that group.

Akranazon•57m ago
Everything you have said here is completely true, except for "not in that group": the cost-benefit analysis clearly favors letting these tools rip, even despite the drawbacks.
agumonkey•54m ago
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.
acedTrex•43m ago
Yep, its a rather depressing realization isnt it. Oh well, life moves on i suppose.

I think we realistically have a few years of runway left though. Adoption is always slow outside of the far right of the bell curve.

gtowey•41m ago
Maybe.

But it's also likely that these tools will produce mountains of unmaintainable code and people will get buried by the technical debt. It kind of strikes me as similar to the hubris of calling the Titanic "unsinkable." It's an untested claim with potentially disastrous consequences.

rapind•20m ago
> 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 YOLO to me. I guess you can somewhat compensate with reams of tests though. (which begs the question, is the dynamic language still saving you time?)

doug_durham•46m ago
I'll push it back against this a little bit. I find any type of deliberative thinking to be a forcing function. I've recently been experimenting with writing very detailed specifications and prompts for an LLM to process. I find that as I go through the details, thoughts will occur to me. Things I hadn't thought about in the design will come to me. This is very much the same phenomenon when I was writing the code by hand. I don't think this is a binary either or. There are many ways to have a forcing function.
hed•40m ago
I think it's analogous to writing and refining an outline for a paper. If you keep going, you eventually end up at an outline where you can concatenate what are basically sentences together to form paragraphs. This is sort of where you are now, if you spec well you'll get decent results.
agumonkey•36m ago
I agree, I felt this a bit. The LLM can be a modeling peer in a way. But the phase where it goes to validate / implement is also key to my brain. I need to feel the details.
vunderba•1h ago
Sounds like the coders equivalent of the Whorfian hypothesis.
PeterStuer•58m ago
Any sufficiently detailed specification converges on code.
chasd00•53m ago
Using AI or writing your own code isn't an xor thing. You can still write the code but have a coding assistant or something an alt/cmd-tab away. I enjoy writing code, it relaxes me so that's what I do but when I need to look something up or i'm not clear on the syntax for some particular operation instead of tabbing to a browser and google.com I tab to the agent and ask it to take a look. For me, this is especially helpful for CSS and UI because I really suck at and dislike that part of development.

I also use these things to just plan out an approach. You can use plan mode for yourself to get an idea of the steps required and then ask the agent to write it to a file. Pull up the file and then go do it yourself.

wasmainiac•52m ago
I also second this. I find that I write better by hand, although I work on niche applications it’s not really standard crud or react apps. I use LLMs in the same way i used to used stack overflow, if I go much farther to automate my work than that I spend more time on cleanup compared to if I just write code myself.

Sometimes the AI does weird stuff too. I wrote a texture projection for a nonstandard geometric primitive, the projection used some math that was valid only for local regions… long story. Claude kept on wanting to rewrite the function to what it thought was correct (it was not) even when I directed to non related tasks. Super annoying. I ended up wrapping the function in comments telling it to f#=% off before I would leave it alone.

the_duke•30m ago
That's because many developers are used to working like this.

With AI, the correct approach is to think more like a software architect.

Learning to plan things out in your head upfront without to figure things out while coding requires a mindset shift, but is important to work effectively with the new tools.

To some this comes naturally, for others it is very hard.

skydhash•18m ago
I think what GP is referring too are technical semantics and accidental complexity. You can’t plan for those.

The same kind of planning you’re describing can and do happen sans LLM, usually on the sofa, or in front of a whiteboard. Or by reading some research materials. No good programmer rushes to coding without a clear objective.

But the map is not the territory. A lot of questions surface during coding. LLMs will guess and the result may be correct according to the plan, but technically poor, unreliable, or downright insecure.

rapind•23m ago
I still do this, but when I'm reviewing what's been written and / or testing what's been built.

How I see it is we've reverted back to a heavier spec type approach, however the turn around time is so fast with agents that it still can feel very iterative simply because the cost of bailing on an approach is so minimal. I treat the spec (and tests when applicable) as the real work now. I front load as much as I can into the spec, but I also iterate constantly. I often completely bail on a feature or the overall approach to a feature as I discover (with the agent) that I'm just not happy with the gotchas that come to light.

AI agents to me are a tool. An accelerator. I think there are people who've figured out a more vibey approach that works for them, but for now at least, my approach is to review and think about everything we're producing, which forms my thoughts as we go.

einpoklum•1h ago
That sounds like the advice of someone who doesn't actually write high-quality code. Perhaps a better title would be "how to get something better than pure slop when letting a chatbot code for you" - and then it's not bad advice I suppose. I would still avoid such code if I can help it at all.
Akranazon•59m ago
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.

whynotminot•55m ago
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.

computerex•42m ago
It's insane! We are so far beyond gpt-3.5 and gpt-4. If you're not approaching Claude Code and other agentic coding agents with an open mind with the goal of deriving as much value from them as possible, you are missing out on super powers.

On the flip side, anyone who believes you can create quality products with these tools without actually working hard is also deluded. My productivity is insane, what I can create in a long coding session is incredible, but I am working hard the whole time, reviewing outputs, devising GOOD integration/e2e tests to actually test the system, manually testing the whole time, keeping my eyes open for stereotypically bad model behaviors like creating fallbacks, deleting code to fulfill some objective.

It's actually downright a pain in the ass and a very unpleasant experience working in this way. I remember the sheer flow state I used to get into when doing deep programming where you are so immersed in managing the states and modeling the system. The current way of programming for me doesn't seem to provide that with the models. So there are aspects of how I have programmed my whole life that I dearly miss. Hours used to fly past me without me being the wiser due to flow. Now that's no longer the case most of the times.

notpachet•46m ago
> in a brand new project

Must be nice. Claude and Codex are still a waste of my time in complex legacy codebases.

bigfishrunning•41m ago
Brand new projects have a way of turning into legacy codebases
computerex•55m ago
Can you be specific? You didn't provide any constructive feedback, whatsoever.
einpoklum•24m ago
The article did not provide a constructive suggestion on how to write quality code, either. Nor even empirical proof in the form of quality code written by LLMs/agents via the application of those principles.
dasil003•41m ago
This take is pretty uncharitable. I write high quality code, but also there's a bunch of code that could be useful, but that I don't write because it's not worth the effort. AI unlocks a lot of value in that way. And if there's one thing my 25 years as a software engineer has taught me is that while code quality and especially system architecture matter a lot, being super precious about every line of code really does not.

Don't get me wrong, I do think AI coding is pretty dangerous for those without the right expertise to harness it with the right guardrails, and I'm really worried about what it will mean for open source and SWE hiring, but I do think refusing to use AI at this point is a bit like the assembly programmer saying they'll never learn C.

egrtah•1h ago
Too bad that software developers are carrying water for those who hate them and mock them for being obsolete in 6-12 months, while they are eating caviar (probably evading sanctions) and clink the champagne glasses in Davos:

https://xcancel.com/hamptonism/status/2019434933178306971

And all that after stealing everyone's output.

atomic128•42m ago
Underground Resistance Aims To Sabotage AI With Poisoned Data

https://news.ycombinator.com/item?id=46827777

whynotminot•58m ago
The real value that AI provides is the speed at which it works, and its almost human-like ability to “get it” and reasonably handle ambiguity. Almost like tasking a fellow engineer. That’s the value.

By the time you do everything outlined here you’ve basically recreated waterfall and lost all speed advantage. Might as well write the code yourself and just use AI as first-pass peer review on the code you’ve written.

A lot of the things the writer points out also feel like safeguards against the pitfalls of older models.

I do agree with their 12th point. The smaller your task the easier to verify that the model hasn’t lost the plot. It’s better to go fast with smaller updates that can be validated, and the combination of those small updates gives you your final result. That is still agile without going full “specifications document” waterfall.

adriand•22m ago
It’s a solid post overall and even for people with a lot of experience there’s some good ideas in here. “Identify and mark functions that have a high security risk, such as authentication, authorization” is one such good idea - I take more time when the code is in these areas but an explicit marking system is a great suggestion. In addition to immediate review benefits, it means that future updates will have that context.

“Break things down” is something most of us do instinctively now but it’s something I see less experienced people fail at all the time.

raphman•48m ago
Hi i5heu. Given that you seem to use AI tools for generating images and audio versions of your posts, I hope it is not too rude to ask: how much of the post was drafted, written or edited with AI?

The suggestions you make are all sensible but maybe a little bit generic and obvious. Asking ChatGPT to generate advice on effectively writing quality code with AI generates a lot of similar suggestions (albeit less well written).

If this was written with help of AI, I'd personally appreciate a small notice above the blog post. If not, I'd suggest to augment the post with practical examples or anecdotal experience. At the moment, the target group seems to be novice programmers rather than the typical HN reader.

i5heu•29m ago
Hi raphman,

i have written this text by myself except like 2 or 3 sentences which i iterated with an LLM to nail down flow and readability. I would interpret that as completely written by me.

> The suggestions you make are all sensible but maybe a little bit generic and obvious. Asking ChatGPT to generate advice on effectively writing quality code with AI generates a lot of similar suggestions (albeit less well written).

Before i wrote this text, i also asked Gemini Deep Research but for me the results where too technical and not structural or high level as i describe them here. Hence the blogpost to share what i have found works best.

> If not, I'd suggest to augment the post with practical examples or anecdotal experience. At the moment, the target group seems to be novice programmers rather than the typical HN reader.

I have pondered the idea and also wrote a few anecdotal experiences but i deleted them again because i think it is hard to nail the right balance down and it is also highly depended on the project, what renders examples a bit useless.

And i also kind of like the short and lean nature of it the last few days when i worked on the blogpost. I might will make a few more blogposts about that, that will expand a few points.

Thank you for your feedback!

flyisopen•43m ago
https://bcantrill.dtrace.org/2025/12/05/your-intellectual-fl...
blmarket•38m ago
Some pattern I found from my hobby project.

1. Keep things small and review everything AI written, or 2. Keep things bloated and let AI do whatever it wants within the designated interface.

Initially I drew this line for API service / UI components, but it later expanded to other domains. e.g. For my hobby rust project I try to keep "trait"s to be single responsible, never overlap, easy to understand etc etc. but I never look at AI generated "impl"s as long as it passes some sensible tests and conforming the traits.

bwestergard•35m ago
Do you think Rust will end up getting a boost from LLM adoption?
rustyhancock•32m ago
It definitely has for me! I just replied to the parent explaining why.

Tl;Dr I don't mind reading rust I hate writing it and the compiler meets me in the middle.

rustyhancock•33m ago
I'm finding Rust is perfect for me with LLMs.

I find rust generally easier to reason about, but can't stand writing it.

The compiler works well with LLMs plenty of good tooling and LSPs.

If I'm happy with the shape of the code and I usually write the function signatures/ Module APIs. And the compiler is happy with it compiling. Usually the errors if any are logical ones I should catch in reviews.

So I focus on function, compiler focuses on correctness and LLM just does the actual writing.

emsign•37m ago
Sounds like an awful lot of work and nannying just to avoid writing code yourself. Coding used to be fun and enjoyable once...
shockwaverider•18m ago
I’m finding it to be the opposite. I used to love writing everything by hand but now Claude is giving me the ability to focus more on architecture. I like just sitting down with my coffee and thinking about the next part of my project, how I’d like it to be written and Claude just fills it in for me. It makes mistakes at times but it also finds a lot of mine that I hadn’t even realized were in my code base.
krashidov•35m ago
> Use strict linting and formatting rules to ensure code quality and consistency. This will help you and your AI to find issues early.

I've always advocated for using a linter and consistent formatting. But now I'm not so sure. What's the point? If nobody is going to bother reading the code anymore I feel like linting does not matter. I think in 10 years a software application will be very obfuscated implementation code with thousands of very solidly documented test cases and, much like compiled code, how the underlying implementation code looks or is organized won't really matter

orwin•15m ago
First article about writing code with AI i can get behind 100%. Stuff i already do, stuff i've thought about doing, and at ideas i've never thought doing ("Mark code review levels" especially is a _great_ idea)

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
505•xnx•5h ago•311 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
133•vecti•2h ago•52 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
74•i5heu•2h ago•49 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
237•aktau•6h ago•125 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
221•ostacke•6h ago•54 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
66•eljojo•2h ago•52 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
85•limoce•3d ago•34 comments

I spent 5 years in DevOps – Solutions engineering gave me what I was missing

https://infisical.com/blog/devops-to-solutions-engineering
42•vmatsiiako•5h ago•11 comments

Understanding Neural Network, Visually

https://visualrambling.space/neural-network/
178•surprisetalk•3d ago•22 comments

Claude Composer

https://www.josh.ing/blog/claude-composer
26•coloneltcb•2d ago•8 comments

I now assume that all ads on Apple news are scams

https://kirkville.com/i-now-assume-that-all-ads-on-apple-news-are-scams/
840•cdrnsf•9h ago•373 comments

Masked namespace vulnerability in Temporal

https://depthfirst.com/post/the-masked-namespace-vulnerability-in-temporal-cve-2025-14986
16•bmit•1h ago•1 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
165•lstoll•6h ago•130 comments

Show HN: BioTradingArena – Benchmark for LLMs to predict biotech stock movements

https://www.biotradingarena.com/hn
12•dchu17•4h ago•3 comments

Welcome to the Room: A lesson in leadership by Satya Nadella

https://www.jsnover.com/blog/2026/02/01/welcome-to-the-room/
11•dnw•4d ago•3 comments

Show HN: Smooth CLI – Token-efficient browser for AI agents

https://docs.smooth.sh/cli/overview
54•antves•1d ago•47 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
298•todsacerdoti•7h ago•171 comments

Planetary Roller Screws

https://www.humanityslastmachine.com/#planetary-roller-screws
12•everlier•3d ago•2 comments

Oregon raised spending by 80%, math scores dropped

https://www.educationnext.org/hard-lessons-from-new-naep-results/
13•grantpitt•28m ago•4 comments

A new bill in New York would require disclaimers on AI-generated news content

https://www.niemanlab.org/2026/02/a-new-bill-in-new-york-would-require-disclaimers-on-ai-generate...
475•giuliomagnifico•11h ago•195 comments

Things Unix can do atomically (2010)

https://rcrowley.org/2010/01/06/things-unix-can-do-atomically.html
236•onurkanbkrc•16h ago•88 comments

The Monad Called Free

http://blog.sigfpe.com/2014/04/the-monad-called-free.html
49•romes•4d ago•25 comments

Invention of DNA "page numbers" opens up possibilities for the bioeconomy

https://www.caltech.edu/about/news/invention-dna-page-numbers-synthesis-kaihang-wang
132•dagurp•11h ago•88 comments

TikTok's 'addictive design' found to be illegal in Europe

https://www.nytimes.com/2026/02/06/business/tiktok-addictive-design-europe.html
546•thm•9h ago•408 comments

Systems Thinking

http://theprogrammersparadox.blogspot.com/2026/02/systems-thinking.html
247•r4um•16h ago•113 comments

NIMBYs aren't just shutting down housing

https://inpractice.yimbyaction.org/p/nimbys-arent-just-shutting-down-housing
110•toomuchtodo•6h ago•235 comments

DNS Explained – How Domain Names Get Resolved

https://www.bhusalmanish.com.np/blog/posts/dns-explained.html
121•okchildhood•3d ago•40 comments

Fraud investigation is believing your lying eyes

https://www.bitsaboutmoney.com/archive/fraud-investigation/
105•dangrossman•4h ago•121 comments

Stay Away from My Trash

https://tldraw.dev/blog/stay-away-from-my-trash
159•EvgeniyZh•3d ago•65 comments

Claude Opus 4.6

https://www.anthropic.com/news/claude-opus-4-6
2249•HellsMaddy•1d ago•969 comments