News for hackers. Stuff that matters.
Re:Notes on rolling out Cursor and Claude Code by robben1234 on Thursday May 08, 2025 @09:57PM (#43933149)
I 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.

There are no comments on this comment yet.