Comment by ljm
2 days ago
Purely anecdotally the one persistent issue I have with LLMs writing code is that they are absolutely paranoid and add a load of indirection and defensive crap and even if you prompt to avoid that it will often require manual steering to remove the cruft.
https://github.com/EspoTek/.claude/blob/master/CLAUDE.md
Stick the "Never suppress errors" section into your Claude.md, this will never happen again (works for me with Python/Flask, ymmv for other languages).
A lot of that sounds like offensive programming: https://en.wikipedia.org/wiki/Offensive_programming
Didn't know there was a word for that, thanks! Looks like my programming style matches my communication style in general. :P
[dead]
Fallbacks and backward compatibility are killing me :) So many code paths that just don't fail predictably.
I’ve experienced this with GPT but not with Opus/Fable.
I experience it with everything including opus/fable.
Though my feeling, no proof, is that the opus/fable today is not what it was months ago. there was a time for about a month where opus was incredible. Just incredible but as fable started to move out i swear to god it feels like sonnet now. Fable feels like opus used to but costs more.
I have not noticed this with Opus 4.6+. The result is usually not too far from what I would have written myself.
Opus 4.6 was the best model in the family, following two ones were seriously brain damaged to do well on benchmarks.
yeah those have been horrible
1 reply →
recent gpts are horrendous for this, whereas recent claudes have a tic where they incessantly add useless comments referring to previous changes and will use multiple single-line comments instead of a standard multi-line docblock.
The incessant need to constantly leave "the code doesn't work like <bad implementation>, it works like <good implementation>" frustrates me to no end. No amount of directions against it in project MEMORY, CLAUDE.md, or even embedded in the prompt seem to be able to stop it from doing this. I don't understand how it could have gotten into the training because I've legitimately never seen an actual person write code comments like this.
It writes code as if the audience is you, the user of Claude, and not other developers reading the code in the future. I found that it helped to instruct it to keep in mind who the audience is and only write comments that describe the current state of the code and never describe anything that can just be inferred from the git history. I found that that helped, and I almost never see these nonsense comments anymore.
Maybe it's self trained. It eats its own output and likes it...
Sounds like my code. They may have been trained on my code!
I tell it to avoid belts and suspenders, don't leave dysfunctional code in, and fail loud. Seems to change that behavior.