3 ms·
> The most common thing that makes agentic code ugly is the overuse of comments. I've seen this complaint a lot, and I honestly don't get it. I have a feeling
by NitpickLawyer 1y ago
> The most common thing that makes agentic code ugly is the overuse of comments.
I've seen this complaint a lot, and I honestly don't get it. I have a feeling it helps LLMs write better code. And removing comments can be done in the reading pass, somewhat forcing you to go through the code line by line and "accept" the code that way. In the grand scheme of things, if this were the only downside to using LLM-based coding agents, I think we've come a long way.
- manojlds 1y agoYeah that's what I do, remove the comments as I read through.
- ellieh 1y agoYou can literally just ask it to not write too many comments, describe the kind of comments you want, and give a couple of examples. Save that in rules or whatever. And it's solved for the future :)
- dockercompost 1y agoI tell them to write self-documenting code and to only leave comments when its essential for understanding, and that's worked out pretty well
- meander_water 1y agoI've noticed Gemini 2.5 pro does this a lot in Cursor. I'm not sure if it's because it doesn't work well with the system prompt or tools, but it's very annoying. There are comments for nearly every line and it's like it's thinking out loud in comments with lots of TODOS and placeholders.
- felipeerias 1y agoThat is because it is thinking out loud. Producing tokens is how it thinks.
- eschaton 1y agoProducing tokens is all it does, it’s not thinking.
- NitpickLawyer 1y agoEh, you really have to take the "thinking" in quotes, in the LLM context "thinking" out loud is what makes the results better. I think (hah) their point stands.
- what 1y agoThey tend to add really bad comments though. I was looking at an LLM generated codebase recently and the comments are along the lines of “use our newly created Foo model”, which is pretty useless.
- duxup 1y agoI agree. I don’t always keep the comments, but I’m 100% ok with them.
- robben1234 1y agoI work with python codebases and consider comments that answer "what?" instead of "why?" bad. LLMs tend to write comments answering "what?", sometimes to a silly extent. What I found helping for using Claude 3.7 was to add this rule in cursor. The fake xml tag helped to decrease the number of times it strays from my instructions. <mandatory_code_instruction> YOU ARE FORBIDDEN FROM ADDING ANY COMMENTS OR DOCSTRINGS. The only code accepted will be self-documenting code. </mandatory_code_instruction> If there's a section of code where a comment answering "why?" is needed this rule doesn't seem to interfere when I explicitly ask it to add it there.
- beefnugs 1y agoIf it helps... shouldn't you be "not deleting them" for future feature additions?