惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Engineering at Meta
Engineering at Meta
T
Tenable Blog
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
P
Privacy & Cybersecurity Law Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Secure Thoughts
N
News and Events Feed by Topic
Google DeepMind News
Google DeepMind News
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
H
Hacker News: Front Page
I
InfoQ
L
LangChain Blog
Security Latest
Security Latest
The Cloudflare Blog
Forbes - Security
Forbes - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Stack Overflow Blog
Stack Overflow Blog
TaoSecurity Blog
TaoSecurity Blog
量子位
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
Scott Helme
Scott Helme
爱范儿
爱范儿
A
Arctic Wolf
F
Full Disclosure
酷 壳 – CoolShell
酷 壳 – CoolShell
Schneier on Security
Schneier on Security
N
News and Events Feed by Topic
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 最新话题
V2EX - 技术
V2EX - 技术
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Know Your Adversary
Know Your Adversary
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - 谢堂文(Darren Xie)

Camstar MES 5.8 發現Ajax事件失效 验证(C#和正则表达式) 新MES已上線 Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine Microsoft SQL Server Reporting Services (SSRS)报表技巧之在图表中增加参考线 MS SQL,数据库增长时众多表中谁是你关注的目标 SQL调优日记之发挥SQL性能与你的写法有关--对比三种方式实现相同功能 想个法子找出性能差的SQL T-SQL 日期处理总结 从MS SQL删除大数据说开去 一步一步用C#写一个检查SQL Server假死警报服务 MM的Windows 7 登录密码忘记之后 基于工作实际需求的Ext.Net和C#搭配应用之一 取出网域(AD)中所有计算机名及位置描述等信息 MS SQL自定义字符串拆分函数的惨痛经历 2012,我的C#全能Excel操作(无需Office,不使用XML) 2012年开发者该做的11件事 取出AD中一個組的所有成員信息(C#實現功能配合EXT做的界面) 一個文件文件和路徑的類 C#路径/文件/目录/I/O常见操作汇总
代码注释规范
谢堂文(Darren Xie) · 2012-01-18 · via 博客园 - 谢堂文(Darren Xie)

一、 注释规范

1、 修改代码时,总是使代码的注释保持最新, 为了防止问题反复出现,对错误修复和解决方法代码必须使用注释。

2、 在每个函数、方法的开始,应该提供标准的注释以指示例程的用途,注释样本应该是解释它为什么存在和可以做什么的简短介绍。

3、 避免在代码行的末尾添加注释;行尾注释使代码更难阅读。

4、 在变量声明时,应在行尾添加注释;在这种情况下,将所有行尾注释应使用公共制表符(Tab)在一处对齐。

5、 避免杂乱的注释,如一整行星号。而是应该使用空白将注释同代码分开。

6、 在编写注释时使用通俗易懂的句子。注释应该阐明代码,而不应该增加多义性。

7、 对由循环和逻辑分支组成的代码使用注释。这些可以帮助源代码读者理解代码书写目的。

8、 在所有的代码修改处加上修改标识的注释,创建标识修改标识由创建或修改人员的姓名加日期组成,如:磊20081216

9、 为了是层次清晰,在闭合的右花括号后注释该闭合所对应的起点。

10、在部署发布之前,移除所有临时或无关的注释,以避免在日后的维护工作中产生混乱。

二、 javascript脚本注释

1、 创建注释

/*

创建标识:汤晓磊磊20081216

方法功能描述:按行政区划编码,查询出符合条件的人员编码

使用的表:

使用的视图:

使用的存储过程:

参数描述:CantonCode:行政区划编码

*/

Function GetPeopleByCantonCode(CantonCode)

{

}// 函数 GetPeopleByCantonCode 结束

2、 修改注释

/*

修改标识:磊20081216

修改内容:在查询语句中加入行政区划编码的限制条件

修改后测试人员确认标识:赵亮(小)20070416

*/

三、 C#文档注释

1、 创建注释

/// <summary>

/// 创建注释

/// 创建标识:磊20081216

/// 方法描述:按照行政区划编码,查询出符合条件的人员编码

/// 使用的表:

/// 使用的视图:

/// 使用的存储过程:

/// </summary>

/// <param name=" CantonCode ">行政区划编码</param>

/// <returns> Str ,查询的结果值</returns>

private string GetPeopleByCantonCode (string CantonCode)

{

Retutn Str;

} // 方法 GetPeopleByCantonCode结束

2、 修改注释

/// <summary>

/// 创建注释

/// 创建标识:磊20081216

/// 方法描述:按照行政区划编码,查询出符合条件的人员编码

/// 使用的表:

/// 使用的视图:

/// 使用的存储过程:

/// 修改注释

/// 修改标识:磊20081216

/// 修改内容:在查询语句中加入行政区划编码的限制条件

/// 修改后测试人员确认标识:赵亮(小)20070416

/// </summary>

/// <param name=" CantonCode ">行政区划编码</param>

/// <returns> Str ,查询的结果值</returns>

private string GetPeopleByCantonCode (string CantonCode)

{

Retutn Str;

} // 方法 GetPeopleByCantonCode结束

四、 SQL注释

1、 创建注释

/*

功能描述:

参数描述:

作者:

创建日期:

完成日期:

*/

2、 修改注释

/*

修改目的:

修改内容描述:

修改人:

修改日期:

完成日期:

*/