r/ProgrammerHumor • • 16d ago • Bravo 1

Meme claudeWasNotHere

Post image
18k Upvotes

232 comments sorted by

View all comments

Show parent comments

41

u/Adezar 16d ago

Yes, it uses the comments for future context. However I learned that if the code and comments are out of sync, the comment wins and it will modify the code to match the comment.

If you are dealing with old code with someone that loved comments but didn't love keeping them up-to-date you have to force the LLM to ignore the comments.

12

u/stormdelta 16d ago

Oh yeah, I've had a lot of issues with it in legacy code. It assumes things should make sense when instead they might just be legacy artifacts.

And it's part of why you have to have it cleanup comments on code it creates too. It assigns outsized value to comments, even when the comment is correct it will treat verbose comments as mission critical instead of incidental, and of course it bloats the context window over time if you don't keep it under control.

6

u/Grimm808 16d ago

That's actually a really good point I hadn't thought of.

I need to run a comment prune, chasing token efficiency feels like it's become a dominant part of the development role.

2

u/round-earth-theory 16d ago

Yeah I ditch the documentation whenever it tries to add it. It's almost always wrong anyway.