跳到正文
lauren· @poteto · X·· 3 小时前AI 评分36
AI 导读

xAI 的 Grok Bot 工程负责人 Lauren Tan 建议在代码库中封禁并删除几乎所有代码注释,因为 AI 智能体倾向于复制已有内容,一条临时 workaround 注释会像杂草一样扩散,导致代码库充斥 hack 和过时注释。

正文

ban and delete most if not all code comments!

agents love copying what already exists. a seemingly harmless comment explaining some temporary workaround is one of the worst viruses you can have in your codebase. like a weed it'll spread quickly as a tool for agents to quickly get their job done. before you know it, your codebase is overrun with hacks and stale comments. just one more workaround bro

you can use pstack's /no-comments skill as a weedkiller. it'll seek out useless comments while keeping the ones that actually should exist (like explaining a browser quirk), and figure out how to solve them on a first principles basis

here's a prompt you can try asking @bot:

create a project agent that uses /poteto-mode to spawn a /swarm to use /no-comments and identify useless code comments we can prune in my repo. come back with a high level plan of which of these workarounds would be best solved by refactoring and which we can straight up delete

https://x.ai/bot/plugin/9717366

来源:lauren · x.com