Remix.run Logo
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?

muglug 2 hours ago | parent | next [-]

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.

stabbles an hour ago | parent | next [-]

Yeah, Claude insists on prompt-affirming comments, and often refers to the previous draft or implementation instead of the status quo.

o-o- an hour ago | parent | prev | next [-]

> 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 an hour ago | parent | prev [-]

Claude assumes humans won't look at code anymore. The comments are for the next Claude that comes in to change something.

rebeccajae an hour ago | parent | prev | next [-]

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.

transdev12 an hour ago | parent | prev | next [-]

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):

    return x + y
netniuq an hour ago | parent [-]

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...

transdev12 an hour ago | parent [-]

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.

rirze 2 hours ago | parent | prev | next [-]

Claude is creating verbose comments with recent models and people are are tired of it

skeledrew 2 hours ago | parent [-]

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.

amdsn an hour ago | parent | next [-]

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.

rplnt an hour ago | parent | prev | next [-]

> 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 an hour ago | parent | next [-]

"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

orwin an hour ago | parent | prev | next [-]

And 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.

an hour ago | parent | prev [-]
[deleted]
hamandcheese an hour ago | parent | prev | next [-]

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.

fpoling an hour ago | parent | prev | next [-]

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.

bryanlarsen an hour ago | parent | prev [-]

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.

eloisant an hour ago | parent [-]

Yes 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!

grim_io 2 hours ago | parent | prev | next [-]

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.

CollinEMac an hour ago | parent | prev | next [-]

Fewer comments is generally a bad thing.

Fewer AI-generated comments is generally a good thing.

WASDx an hour ago | parent | prev | next [-]

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...

splap an hour ago | parent | prev | next [-]

I find claude often comments about what the code *does not* do. Relevant at the moment, but doesn't belong in the codebase.

an hour ago | parent | prev [-]
[deleted]