Comment by mattashii
1 day ago
The percentage of comments in line counts doesn't measure the quality of the comments, nor the quality of the codebase.
It's rather easy to get over 50% by putting a comment above each line of code, containing the output of an LLM that's asked "what does this line do" and supplied with exactly that line of code. It's much harder to make sure the comments make sense and actually add value.
"The SQLite source code is over 35% comment. Not boiler-plate comments, but useful comments that explain the meaning of variables and objects and the intent of methods and procedures. The code is designed to be accessible to new programmers and maintainable over a span of decades. "
They try!
got me thinking that it would be interesting to remove all comments that cant be reproduced by llm on code base with comments stripped out.
If the llm can produce similar enough comment from scratch, would it be better to just have an IDE that dynamically injects comments when you need as opposed to them being in version control?
One of the stated goals is to have long-term support and maintainability. Adding in a dependency like an IDE is already a large step away from that goal, and to include a dependency on a LLM's non-auditable output actively steps away from that.
Comments in source code are always going to meet the maintainer's intention and will much more likely cover the use cases that comments are meant to cover - unintuitive cases or decisions, unclear algorithms, general usage to point maintainers in the right direction, and so on. More importantly, comments in the source code require no additional tools or other dependencies and as such are more dependable.
Why would I want comments produced by a roll of the dice rather the human who was in the thick of it?
I would instead be willing to consider some kind of QC assessment. Where does AI think the comment does not match the code because something has fallen out of sync.
I think people are misreading this. I said
> all comments that cant be reproduced by llm
Not remove all comments.
meaning if your comment is so low quality that an LLM will generate it for you by reading the code, then it doesn't belong in VCS
1 reply →