跳到正文
Lauren Tan· X:Lauren Tan(SpaceXSI,Grok Bot 工程负责人) (@poteto)·· 3 小时前AI 评分58

xAI 工程师建议删除代码注释,推出 /no-comments 技能

xAI 工程师建议删除代码注释,推 /no-comments 技能

AI 导读

xAI 工程师 Lauren Tan 建议删除代码库中大部分甚至全部注释,理由是智能体倾向于复制已有内容,一条看似无害的临时绕过注释会像杂草一样扩散,最终让代码库充斥 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 Tan · x.com