Top
Best
New

Posted by i5heu 5 hours ago

How to effectively write quality code with AI(heidenstedt.org)
101 points | 77 commentspage 2
emsign 2 hours 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 2 hours 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.
xandrius 1 hour ago||
Yep, I get that some people love the act of literally typing "x = 2;" but to me coding is first and foremost problem solving. I have a problem (either truly mine or someone else's), I come up with a solution in my head and slowly implement it.

Before I also had to code it and then make sure it had no issues.

Now I can skip the coding and then just have something spit out something which I can evaluate whether I believe is a good implementation of my solution or not.

Of course, you need the skill to know good from bad but for medium to senior devs, AI is incredibly useful to get rid of the mundane task of actually writing code, while focusing on problem solving with critical review of magically generated code.

sakopov 2 hours ago||
Every engineering org should be pleading devs to not let AI write tests. They're awful and sometimes they literally don't even assert the code that was generated and instead assert the code in tests.
johnsmith1840 2 hours ago||
How to write good code with AI -> put in as much effort as you did before on 20% more code than you used to work with.
orwin 2 hours 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)
raphman 3 hours 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 2 hours 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 3 hours ago||
https://bcantrill.dtrace.org/2025/12/05/your-intellectual-fl...
krashidov 2 hours 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 2 hours ago||
That's the opposite. I've never read and re-read code more than i do today. The new hires generate 50 more code than they use to, and you _have_ to check it or have compounding production issues (been there, done that). And the errors can now be anywhere, when before you more or less knew what the person writing code is thinking and can understand why some errors are made. LLMs errors could hide _anywhere_, so you have to check it all.
bornfreddy 1 hour ago||
Isn't that a losing proposition? Or do you get 50 times the value out of it too? In my experience the more verbose the code is, the less thought out it is. Lots of changes? Cool, now polish some more and come back when it's below 100 lines change, excluding tests and docs. I don't dare touch it before.
gck1 1 hour ago||
They serve as guardrails for agents to not do stupid things.

If your goal is for AI to write code that works, is maintainable and extensible, you have to include as many deterministic guardrails as possible.

einpoklum 3 hours 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.
dasil003 3 hours 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.

Akranazon 3 hours 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 3 hours 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.

falloutx 2 hours ago|||
Its only revolutionary if you think engineers were slow before or software was not being delivered fast enough. Its revolutionary for some people sure, but everyone is in a different situation, so one man's trash can be other man's treasure. Most people are treading both paths as automation threatens their livelihood and work they loved, also still not able to understand why would people pay to companies that are actively trying to convince your employer that your job is worthless.

Even If I like this tech, I still dont want to support the companies who make it. Yet to pay a cent to these companies, still using the credits given to me by my employer.

whynotminot 2 hours ago||
Of course software hasn’t been delivered fast enough. There is so so so much of the world that still needs high quality software.
computerex 3 hours 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.

pletnes 1 hour ago||||
Claude code is great at figuring out legacy code! I dont get the «for new systems only» idea, myself.
notpachet 3 hours ago|||
> in a brand new project

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

bigfishrunning 3 hours ago|||
Brand new projects have a way of turning into legacy codebases
bornfreddy 1 hour ago|||
What are you talking about? Exploring and explaining the legacy codebases is where they shine, in my experience.
computerex 3 hours ago|||
Can you be specific? You didn't provide any constructive feedback, whatsoever.
einpoklum 2 hours 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.
computerex 2 hours ago||
Yes it did, it provided 12 things that the author asserts helps produce quality code. Feel free to address the content with something productive.
xandrius 1 hour ago||
Look up luddites on Wikipedia, might be too deep to see the similarities though.
th0ma5 3 hours ago|
[dead]