▲ | evanmoran a day ago | ||||||||||||||||||||||||||||||||||||||||||||||
I know this is highly controversial, but I now leave the comments in. My theory is that the “probability space” the LLM is writing code in can’t help but write them, so if i leave them next LLM that reads the code will start in the same space. Maybe it’s too much, but currently I just want the code to be right and I’ve let go of the exact wording of comments/variables/types to move faster. | |||||||||||||||||||||||||||||||||||||||||||||||
▲ | stuaxo 21 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||
Similar logic, but hard disagree on keeping comments that are exactly what the following code does. They are useful to the LLM in writing the code (which comes after). But when it comes to an LLM reading that code later its just a waste of context. For humans its a waste of screen space. A comment should only explain what the following thing does if its hard to parse for some reason. Otherwise it should add information: why something is as it is, I.e. some special case, add breadcrumbs to other bits of the code etc. I wish these coding agents had a post step to remove any LLMish comments they added during writing, and I want linters that flag these. | |||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||
▲ | jychang a day ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||
I think the code comments straight up just help understanding, whether human or AI. There's a piece of common knowledge that NBA basketball players can all hit over 90% on free throws, if they shot underhand (granny style). But for pride reasons, they don't throw underhand. Shaq just shot 52%, even though it'd be free points if he could easily shoot better. I suspect there's similar things in software engineering. I've seen plenty of comments on HN about "adding code comments like a junior software engineer" or similar sentiment. Sure, there's legitimate gripes about comments (like how they can be misleading if you update the code without changing the comment, etc), but I strongly suspect they increase comprehension of code overall. | |||||||||||||||||||||||||||||||||||||||||||||||
|