代码注释格式
注释的原则
- 不要注释显而易见的事情
- 应当与描述的对象相一致
- 清楚指向所描述的内容(哪一行或哪个代码块)
- 可读性,易读性
- 有些注释可使用代码拼成简单的图像来说明
使用python注释符号#,其他语言同理
单行代码注释
#This is a short code comment
特殊代码标记(>后可跟自定义标记字母)
#This is a code mark>>>>>>>>M
函数/模块内注释(多级)
#--------This is a in function code part comment
#======== This is a in function code part comment ========
######### This is a in function code part comment ########
代码文件总纲(总体功能描述)
#********************************
#This is a total description
#********************************
模块注释
#-----------------------------------------------
#| This is a module description |
#-----------------------------------------------
Comments
Post a Comment