Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 366 Bytes

File metadata and controls

9 lines (7 loc) · 366 Bytes

什么样的注释是好的

写出言简意赅的注释

  • 当像 “这里” 和 “it” 这样的代词可能指代多个事物时,避免使用它们
  • 尽量精确的描述方法行为
  • 在注释中用精心挑选的输入/输出例子进行说明
  • 声明代码的高层次意图,而非明显的细节
  • 用含义丰富的词来使注释更加简洁