4 ms·
Your LLMs get rid of comments? Mine add them incessantly.
by Wowfunhappy 1y ago
Your LLMs get rid of comments? Mine add them incessantly.
- ls612 1y agoI have to yell at Gemini to not add so many comments it almost writes more comments than code by default.
- hu3 1y agocheck your AGENTS.md or equivalent most of the times when LLM is misbehaving, it's my fault for leaving outdated instructions
- taormina 1y agoNah, it's definitely not that. I have it explicitly several times over in that file and it insists on commenting so much it's absurd.
- lukeschlather 1y agoI think it's very valuable. If there are a bunch of redundant comments I know I haven't actually validated this code does anything useful. I go through line by line and delete all the comments while validating that they do in fact reflect what the code does.
- evanmoran 1y agoI 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.
- jychang 1y agoI 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.
- thenanyu 1y agoI hate this analogy. NBA players can all hit 90% of their free throws shooting overhand too. Just some of them are much worse at handling the pressure and pace change of the situation in a game context.
- oblio 1y agoThe underhanded throw is mechanically just better for free throws. Much easier to put backspin, for example. It's just a shot that doesn't help anywhere else.
- thenanyu 1y agoThat’s beside the point. It wouldn’t help shaq or any of those big men hit free throws. They have no problems with mechanics.