代码注释的格式

写软件代码期间:

各种语言都有自己的常见的写注释的约定俗成的方式:

有了大家一起都常用的,都遵守的格式,作用是:

就可以通过第三方的工具,去将代码中的注释提取出来,形成代码的文档

即:从代码中生成文档

比如:

举例

Xcode

有对应的插件,帮你自动生成格式:

给Xcode添加支持给iOS代码写注释和文档

GitHub - onevcat/VVDocumenter-Xcode: Xcode plug-in which helps you write documentation comment easier, for both Objective-C and Swift.

code_comment_xcode_doc

code_comment_xcode_doc_2

results matching ""

    No results matching ""