This naturally gets me close to the 1/3rd mark, I find, without really trying. When that code is shared with others, they typically report back that it’s very easy to read quickly and make adjustments.
But again, that’s my entirely subjective experience.
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.
They try!
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?
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.
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.
> 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
An LLM can generate many valid reasons for doing X, including the right one, but you can't know which one of those it will give you
This is a gold standard for documenting source code, in my experience. It doesn’t entirely solve the “bus” problem, but reduces the barrier to entry for new maintainers or project resuscitators substantially by making it easy to understand what’s going on and why decisions were made.
Admittedly, my own code is also in that 35% range for commenting, so I’m inherently biased towards that threshold specifically. YMMV.