注释/Comments
When they are needed, use comments to explain why a particular piece of code does something. Comments must be kept up-to-date or deleted.
需要的时候,用注释来解释为什么这个代码片段要做这些事情。注释应当保持最新的状态,否则就该被删除。
Avoid block comments inline with code, as the code should be as self-documenting as possible. Exception: This does not apply to those comments used to generate documentation.
避免出现大块的代码注释,代码应该尽可能自文档化。例外:这条规则不适用于生成文档的注释。
译者注:详情见链接
Avoid the use of C-style comments (/* ... */
). Prefer the use of double- or triple-slash.
避免使用 C 风格的注释方式(/* ... */
),尽量使用 2 个或 3 个斜杠进行注释。