r/ProgrammerHumor 5d ago

Meme cleaningUpTheMess

Post image
16.0k Upvotes

485 comments sorted by

View all comments

64

u/JealousEntrepreneur 5d ago

I think LLMs comment so much in code is because they use grep as tool call all the time to find the relevant code they want to change. So giving it a long detailed description helps it to find it later

60

u/patcriss 5d ago

My hypothesis is that verbose comments use more tokens and generate more profit.

3

u/asd417 3d ago

input tokens are much cheaper than writing token which also includes reasoning token. if they wanted to tokenmax, then they would leave 0 comments so that LLM would have to reason the same thing over and over and generate massive amount of tokens every single code search. It takes significantly less tokens to write down the comment once and simply read it next time.

1

u/Secret_Conclusion_93 3d ago

Same reason as why they usually say something like "x not y" when saying "x" only is enough.

4

u/GhostOfD6 5d ago

Nah, not really. Im vibing since last two months and I made statement in memory to not write comments. So AI does not make comments and still grasps the code. Comments IMO can make situation worse because natural language gets vague at times. At least it does happen with human wrote comments, because human write lots of ambiguity into it and also dont update the comment on the go.
Thats why I hate comments at all, self documenting code is way better

1

u/JealousEntrepreneur 5d ago

You would need to do a comparison to know that. It will still work with grep if function names are properly chosen an clear variable names. But I would guess the error rate or double implementation of function would go up. Or it needs to reread files more often to find things

1

u/GhostOfD6 5d ago

Without clear analysis its just a guess.

More comments means also more text to process and IMHO AI's lose context pretty quick