I want very little comments in code. Functions should tell me what they do. And tbat's about all I really want.
Then if something is truely odd, then yes tell me what is going on in a comment. But in general there probably should not be comment in a function body.
Even claude needs context. Whether its a human or an LLM looking at a piece of code, the only way either will understand why you took a weird route is if you add context to it through a comment. There are genuinly times when the environment calls for some weird workaround, and an LLM that is trained on 'general best practices' will not understand why you did that and just change it to a broken version that might have already been used in the past and failed.
1
u/esaule 21d ago
I want very little comments in code. Functions should tell me what they do. And tbat's about all I really want.
Then if something is truely odd, then yes tell me what is going on in a comment. But in general there probably should not be comment in a function body.