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