注释规范
注释规范
-
1、文件顶部注释(推荐使用)
1
2
3
4
5/*
* @description: xxxxx中文说明
* @author: zhifu.wang
* @update: zhifu.wang (2012-10-17 18:32)
*/ -
2、模块注释(推荐使用)
1
2
3/* module: module1 by zhifu.wang */
…
/* module: module2 by zhifu.wang */模块注释必须单独写在一行
-
3、简单注释
-
3.1 单行注释
1/* this is a short comment */单行注释可以写在单独一行,也可以写在行尾
-
3.2 多行注释
1
2
3
4/*
* this is comment line 1.
* this is comment line 2.
*/多行注释必须写在单独行内
-
4、特殊注释(推荐使用)
1
2/* TODO: xxxx by zhifu.wang 2012-10-18 18:32 */
/* BUGFIX: xxxx by zhifu.wang 2012-10-18 18:32 */用于标注修改、待办等信息
-
5、长度要求:注释中的每一行长度不超过40个汉字,或者80个英文字符