4 ms·
> Changes created by Codex had fewer comments in Ruby/Ruby on Rails code. I liked that a lot, and I will soon share some experiments I ran on this. Why is fewe
by beering 1mo ago
> Changes created by Codex had fewer comments in Ruby/Ruby on Rails code. I liked that a lot, and I will soon share some experiments I ran on this.
Why is fewer comments a good thing?
- rirze 1mo agoClaude is creating verbose comments with recent models and people are are tired of it
- skeledrew 1mo agoThose verbose comments provide context for why something is there way it is, so it can take those decisions in account when making changes in the future.
- rplnt 1mo ago> why something is there way it is It writes out stories describing what isn't there or what used to be there. It's usually not helpful, just noise. It also likes to write it in very verbose AI-styled prose.
- zormino 1mo ago"don't write a goddamn novel" <- I've said this to claude way too many times, nothing you can do actually seems to make it significantly less verbose
- deleted 1mo ago[deleted]
- orwin 1mo agoAnd the way they are written is rather unhelpful: '//this not cosmetic: this css helps the user understand where he should click'. The 'this is not' pattern is useless at best.
- skeledrew 1mo agoIt's likely not helpful to you, but it is to Claude. Basically a memory entry at the exact point of relevance, with the same caveats. One advantage though is it survives cloning, so another using the project benefits.
- rplnt 1mo agoIt's only helpful to Claude in that it wastes more tokens and costs more.
- skeledrew 1mo agoIt does visibly use a few more tokens in the short term. But it hurts Claude's ability in the long term if removed because it has to either think more every time it encounters that section in the code (more invisible thinking tokens used), or there's an increased risk of making a maladaptive change without context. Heck I've been bitten enough times already by it, though more recently it's cross project concern where Claude rediscovers some root cause that was already found and documented (I have it save a centrally-located writeup for things that took serious work to learn, when I remember, but I still need to make that knowledge pool known to other agents/sessions without having to manually prompt each time) elsewhere. Problem is today's LLMs don't have the long term memory that humans have, and so remembering the reason behind a given change/decision has to be preserved in some way if it's non-obvious. Hence why there is {AGENTS|CLAUDE}.md, the auto-memory system, and 1001 variants of memory implementations in the wild. All are trying to ensure that LLMs can have the context they need at the location and time they need it. And you want to block Claude from using a technique that it natively finds helpful.
- amdsn 1mo agoIf they have in mind what I think of when I think of claude comments then frequently they are only relevant to the back and forth that produced the code and are exaggerated to the point of being misleading. A very common example is to land on something that isn't quite right or doesn't quite work, prompt an adjustment, and then the adjustment will have some grandiose prose about "preventing the critical bug that shipped once." People just need to clean up such litter manually but it would be nice if the models generated less of it.
- bryanlarsen 1mo agoThose massive comments generally refer to intermediate states that never shipped, making them utterly useless, noisy and confusing as a permanent artifact. They're sometimes useful to reviewers, so a commit message or pull request comment is much more appropriate.
- eloisant 1mo agoYes I hate when Claude explain in comments how it is now compared to how it was before, or how it could be if a different decision had been taken. Dude, just talk about the current state of the code!
- skeledrew 1mo ago> useless, noisy and confusing That's your perspective. For Claude that's an extension of its thinking, which makes it work better. Just like the person who takes notes so they have references for later. Take it away and you're negatively impacting outcomes.
- bryanlarsen 1mo agoNo, it's the other way around. If you put a comment "don't do foo" in your code, you're biasing future readers, human or artificial, to think about foo when you explicitly want them not to.
- skeledrew 1mo agoIt isn't about making readers not think about foo. It's about biasing thought about foo in a particular direction. And I've seen it work multiple times: agent mentions it encountered X comments in the code and revised its action as a result (yes, I read live agent transcripts).
- fpoling 1mo agoIf one needs to dig history, then git log -p and similar are way more useful and reflect the real history rather than LLM inference about it. Comments reflecting the goal are more useful as neither history nor code itself covers it.
- skeledrew 1mo agoLooking into git history is an active decision that's usually only done after something undesirable happens, and now there's the need to try and find why. Better to have the context passively loaded as part of working with the relevant section of the code, and likely prevent that something from even happening in the first place. Think Chesterton Fence.
- hamandcheese 1mo agoThe story of how the code got to a certain state belongs primarily in git commit messages, not in comments. Comments should serve to aid in understanding of the code, highlight footguns or hidden dependencies, etc. Claude very often litters code with comments about decisions that were made within a single session/pull request, its just noise.
- cageface 1mo agoThe new concise output style they just released definitely helps with Opus 5 in general.
- muglug 1mo agoClaude can add comments in code that are better just living as a comment on the PR. You'll ask it to do something and it'll comment the code with an answer to what you asked it, rather than just explanatory comments to whoever comes after. There's also a second issue that if the code is actually incorrect, the comment can nevertheless bolster the case for it.
- o-o- 1mo ago> Claude can add comments in code that are better just living as a comment on the PR. Not to Claude – its own, old comments have helped me/it solve new issues on more than one occasion.
- jedberg 1mo agoClaude assumes humans won't look at code anymore. The comments are for the next Claude that comes in to change something.
- iammrpayments 1mo agoThis is not true, the comments confuse claude itself and even eat context
- stabbles 1mo agoYeah, Claude insists on prompt-affirming comments, and often refers to the previous draft or implementation instead of the status quo.
- grim_io 1mo agoClaude comments often contain the whole iterative chain of decisions that led to the current state. Useful for the LLM to know the "why", but not something a human would do, unless it's a very critical and confusing part of the code.
- rebeccajae 1mo agoI found that Claude would litter the codebase with what felt like notes-to-self. Sometimes it would make an abstraction that wasn't very well thought out and when I pushed back on this choice, it would usually go with something more along the lines of what I suggested in my pushback, but left a comment like "use the git CLI instead of re-implementing git" or something. It felt like it was commenting on the diff sometimes instead of what the code was doing.
- mitjam 1mo agoYes, it feels like Claude is using code comments as a message board.
- CollinEMac 1mo agoFewer comments is generally a bad thing. Fewer AI-generated comments is generally a good thing.
- deleted 1mo ago[deleted]
- transdev12 1mo agoClaude comments look like this //add returns the sum of x and y //per section 2.1 of addition-implementation-plan.md sum is designed as the seam for user addition interfaces. //previously sum added numbers, now it adds numbers def add(x, y): return x + y
- netniuq 1mo agojust reading this comments made me despise the fact that I have to read this shit again tomorrow It's really time to move to OpenAI...
- transdev12 1mo agoI’m trying to pitch my boss on something like bedrock/foundry/vertex where we can just swap the model and still have it serverless over an api. Digital ocean particularly looks promising as well.
- ptrl600 1mo agoNot subtraction, not division.
- WASDx 1mo agoGood code is self-explanatory and don't need comments. I can really recommend the book Clean Code, here is a summary: https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29#comments-rules https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988c...
- splap 1mo agoI find claude often comments about what the code *does not* do. Relevant at the moment, but doesn't belong in the codebase.