湖北国际软件外包人才培养基地 程序编码规范
1.2 Class 的命名.........................................................................................................................1
1.3 局部变量的命名...................................................................................................................1
1.4 Static 变量的命名.................................................................................................................1
1.5 参数的命名...........................................................................................................................1
1.6 数组的命名...........................................................................................................................1
1.7 方法的参数...........................................................................................................................2
2. C#文件样式....................................................................................................................................2
2.1 版权信息...............................................................................................................................2
2.2 Package/Imports....................................................................................................................2
2.3 类的注释...............................................................................................................................3
2.4 类...........................................................................................................................................3
2.4.1 成员变量....................................................................................................................3
2.4.2 构造函数....................................................................................................................3
2.4.3 类方法........................................................................................................................3
2.4.4 ToString 方法.............................................................................................................4
2.4.5 main 方法...................................................................................................................4
3. 代码编写格式.................................................................................................................................4
3.1 缩进...............................................................................................................................4
3.2 页宽...............................................................................................................................4
3.3 换行...............................................................................................................................5
3.4 {} 对..............................................................................................................................5
3.5 括号...............................................................................................................................5
3.6 每行申明变量的数量...................................................................................................6
3.7 初始化...........................................................................................................................6
3.8 布局...............................................................................................................................6
3.9 简单语句.......................................................................................................................6
3.10 返回语句.....................................................................................................................7
3.11 if-else 语句..................................................................................................................7
3.12 空格.............................................................................................................................7
4. 程序编写规范.................................................................................................................................7
4.1 异常...............................................................................................................................7
4.2 final 类...........................................................................................................................8
5. 编程技巧.........................................................................................................................................8
6. 性能.................................................................................................................................................8
——————————————————————————————————————————————