Back to News
Advertisement

AI coding is a nightmare. Am I the only one experiencing this?

ssollawen about 5 hours ago 12 comments
Here are my biggest gripes with AI coding assistants right now: Obsessed with reinventing the wheel. You'll often find it writing three duplicate functions for the exact same feature in a single file. Why? Because it's terrified of blowing up the context window, so it only reads a fraction of a large file and completely misses the existing functionality. Why are files so bloated in the first place? Because AI prefers adding new code over modifying existing code, and it rarely deletes anything. After a few iterations, your codebase becomes a mountain of dead code. Zero holistic awareness. It hyper-focuses on the current task and couldn't care less if its changes break other parts of the system. If you point out that the original logic is now broken, it treats it as a brand-new task. It’ll fix that specific bug, but whether its newly written code still works after the fix? "Not my problem." The context window is painfully short. If you try to solve the issues above by dumping all the necessary context into the prompt, you'll hit the 200k token limit in no time. After just two more turns, it triggers auto-compacting, and suddenly it turns back into an idiot. Long context = instant brain damage. Just when you've painstakingly stuffed the perfect amount of context into the window, the model completely loses its mind. The longer the context, the more incoherent its responses become. Logical reasoning is practically non-existent. A simple feature that would take a human dev 3-5 lines of code to tweak in an existing function? The AI will insist on designing an entirely new system architecture for it. The more you tune it, the dumber it gets. You burn through millions of tokens, and every time it replies with "I understand!" or "I've got it completely!", the code it spits out still refuses to run.
Advertisement

⚑ Community Insights

Discussion Sentiment

50% Positive

Analyzed from 363 words in the discussion.

Trending Topics

#code#model#function#agents#review#agent#don#own#architecture#llm

Discussion (12 Comments)Read Original on HackerNews

FearNotDanielβ€’37 minutes ago
Sorry you're struggling. There are tons of resources out there from people who've been through the same pain and built up techniques to mitigate them. Matt Pocock's YouTube channel is one good starting place, there are many others. One key tip though is - you own the architecture of your application. If your files have become bloated over several rounds of LLM-generated code, that is primarily your responsibility to observe and push back on that, to ensure your repo as a brief but firm AGENTS.md or CLAUDE.md to describe architectural non-negotiables and some kind of /code-review skill that you give to a second agent to review the first agent's work against those standards. Worried about LLM changes introducing regressions? That's why you have a test suite, and you read what the agent changes to ensure the tests themselves are still checking for correct behaviour.
denn-gubskyβ€’about 3 hours ago
If you model starves because of small context window (your described symptoms), then I would suggest: a) Split the job between agents, each with it's own context window; b) Use advanced model as orchestrator for multiple coding/testing/reviewing agents; c) Use code indexers like https://github.com/ory/lumen or/and https://github.com/defendend/Claude-ast-index-search d) Use planning and detailed specifications preparation before the coding phase.
MarvinYorkβ€’22 minutes ago
I don't have those experiences with Codex (5.5 xhigh).
minibucketβ€’42 minutes ago
Yeah. That drives me crazy too! function addData() {..... function addDataNew() {.... function addDataForAddData {.... function addDataForNewAddData {...
pbgcp2026β€’5 minutes ago
What a pitiful state of programming affairs ... Just couple of years ago we have been discussing new libraries and tech architectures and algos. Today we discuss how to "shoehorn" some 3rd party crap into making your life miserable. Best case scenario: it will get smart(er) and replace you. (Yeah, the cope of "owning your architecture") Worst case: you redo all that shite by hand and still get replaced. And the tragedy? We ceased being programmers. We don't even qualify as code monkeys anymore ...
YuriNiyazovβ€’about 4 hours ago
What model are you running? With what settings?
sollawenβ€’39 minutes ago
mostly I am using GLM5, with miniMax-3 to do some easy work.
nullcβ€’about 3 hours ago
Worst negative pattern I've seen is hyper defensive programing. E.g.

  try:
    something_that_should_not_fail_and_if_it_does_our_assumptions_are_all_wrong()
  except:
    fallback_that_will_not_result_in_correct_behavior_but_make_failure_hard_to_detect()
But, of course, it depends a lot on which models you're using and how you instruct them.
andyjohnson0β€’about 2 hours ago
Please don't post rants on Ask HN.
quintesβ€’about 3 hours ago
My convention file says no mass rewrites. Plan. Assess. Spec. Code review. Depends on your model I guess
tamrixβ€’about 4 hours ago
Sounds like more of a rant than a question and for that you get a ranty reply. Ask the AI how to improve your results.
sphβ€’19 minutes ago
The post is decidedly a question. It is a forum, people come to interact with humans and exchange opinions.