代码添加注释规范
来源:互联网 发布:新天龙八部lua源码 编辑:程序博客网 时间:2024/05/16 08:30
没有注释的代码就是一坨屎,又烂又臭。
在写代码时就应该添加注释,这时在你的脑子里的是清晰完整的思路。
如果在代码最后再添加注释,它将花费你双倍的时间。
1、对每个类添加注释:包括摘要信息,作者信息,最近修改日期等;
// AppReviewAlertView.h
// iSuzhouCity
//
// Created by Chen Nan on 5/24/11.
// Copyright 2011 Yulong. All rights reserved.
//
// Utility classes
// Prompts users to rate the app via App Store,
// if they have use the app for defined days and defined times.
//
// Revision History
// 2011-05-24 | Charles | First draft.
// 2011-06-29 | Charles | 设置产品化的参数.
2、对每个方法添加注释:包括用途、功能和返回值。
/*
Must Call this method at the end of app delegate's
application:didFinishLaunchingWithOptions: method.
The rating alert
can also be triggered by appEnteredForeground: and userDidSignificantEvent:
(as long as you pass YES for canPromptForRating in those methods).
*/
+ (void)appLaunched:(BOOL)canPromptForRating;
3、对一些变量添加注释;
4、用TODO标签表示该段代码还未完成;
// TODO: implement the datepickview
- 代码添加注释规范
- 给php代码添加规范的注释
- 代码规范之在函数之前添加注释
- 给php代码添加规范的注释phpDocumentor
- 给php代码添加规范的注释phpDocumentor
- 代码注释规范[转]
- Java代码注释规范
- C# 代码注释规范
- 代码注释规范
- 代码注释规范(1)
- 代码注释规范(2)
- 代码注释规范(3)
- C# 代码注释规范
- JAVA代码注释规范
- java代码注释规范
- js代码注释规范
- 代码中的注释规范
- C++代码注释规范
- 有关Constructor call must be the first statement in a constructor的问题
- textview属性值
- MyEclipse new 后面的菜单选项设置
- IOS开发之----XCode代码注释#pragma mark使用
- dp、sp和px的区别
- 代码添加注释规范
- MySQL安装出现error Nr.1045
- MySQL不能显示中文问题
- Tomcat部署后工程名修改方法
- 学习笔记 用例图,类图,时序图
- JSP中window.open("index.jsp","_self")无效
- Mysql中不能使用top关键字,而使用limit关键字
- S3C6410的时钟频率
- Nginx的锁的实现以及惊群的避免