加载中...

Just in case 很多朋友不知道
软件工程里有个写代码的原则 就是最好的注释就是代码本身
因为注释不参与程序运作,很容易忘记维护/更新,且所有写在注释里的东西(如限制),都实际上无法保证生效
最好的办法就是在代码层面把注释里的东西做到(现在很多agent喜欢写各种文档、注释,我们其实应该是时不时提醒一下它们这个代码即注释代码即文档的原则,别一顿框框写文本形式的文档
所以大家可以试试把这个写到claude.md里
Follow a general principle that the best doc is the code itself. If you are trying to warn future devs of anything, enforce a pattern, or restrict an anti-pattern, try implementing it in code so it's structurally correct, checked in compile time, and can be unit tested.
Copyright © 2026 RADHOST PTE. LTD. (UEN: 202450723N). All Rights Reserved.