Comment by beering
2 hours 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?
2 hours 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?
Claude 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.
Yeah, Claude insists on prompt-affirming comments, and often refers to the previous draft or implementation instead of the status quo.
> 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.
Claude assumes humans won't look at code anymore. The comments are for the next Claude that comes in to change something.
I 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.
Claude 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):
just 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...
I’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.
Claude is creating verbose comments with recent models and people are are tired of it
Those 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.
> 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.
3 replies →
If 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.
The 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.
If 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.
Those 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.
1 reply →
Claude 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.
Fewer comments is generally a bad thing.
Fewer AI-generated comments is generally a good thing.
Good 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/73c6914cc446146b8b533c0988c...
I find claude often comments about what the code *does not* do. Relevant at the moment, but doesn't belong in the codebase.