当前位置:网站首页>C# 编码规范手册
C# 编码规范手册
2022-08-02 05:17:00 【淡定九号】
C# 编码规范手册
引言
目的
明确C#编写的源程序和测试程序都符合相同的规范,达到一致性与统一性,以便于程序的后期维护和变更。
一个软件的生命周期中,80%的花费在于维护。几乎没有任何一个软件,在其整个生命周期中,均由最初的开发人员来维护;
编码规范可以改善软件的可读性,可以让程序员尽快而彻底地理解新的代码。为了执行规范,每个软件开发人员必须一致遵守编码规范;
使用统一编码规范的主要原因,是使应用程序的结构和编码风格标准化,以便于阅读和理解这段代码;
好的编码约定可使源代码严谨、可读性强且意义清楚,与其它语言约定相一致,并且尽可能的直观。
说明:编码规范是为了增加代码的可读性,没有所谓的对错,不必纠结于那样写对还是错。
术语定义
- Pascal 命名法:将标识符的首字母和后面连接的每个单词的首字母都大写。可以对三字符或更多字符的标识符使用 Pascal 大小写。例如: BackColor。
- Camel 命名法:标识符的首字母小写,而每个后面连接的单词的首字母都大写。例如: backColor。
- 大写:标识符中的所有字母都大写。仅对于由两个或者更少字母组成的标识符使用该约定。例如:System.IO,System.Web.UI。
- 文档的规范分为三种:【强制】【推荐】【参考】,表示规范需要遵循的级别
- 匈牙利命名法:匈牙利命名法是一种
边栏推荐
- 51 MCU peripherals: DS18B20
- nacos注册中心
- Common functions of pytorch
- 【OpenCV从入门到实践】图像处理技术[像素](全网最详细)
- What are the ways to improve software testing capabilities?After reading this article, it will take you up a notch
- 回文串求解的进阶方法
- Detailed explanation of interface in Go language
- Linux CentOS8安装Redis6
- Double for loop case (use js jiujiu printing multiplication table)
- 高防服务器防御的原理是什么
猜你喜欢

leetcode一步解决链表反转问题

Deep learning - CNN realizes the recognition of MNIST handwritten digits

国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐

BGP实验(路由反射器,联邦,路由优化)

There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?

BGP experiment (route reflector, federation, route optimization)

51 MCU Peripherals: Infrared Communication
![[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays](/img/eb/9b05508e88b7f17d80de2afa8c08ce.png)
[C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays

区块元素、内联元素(<div>元素、span元素)

双重for循环案例(用js打印九九乘法表)
随机推荐
腾讯大咖分享 | 腾讯Alluxio(DOP)在金融场景的落地与优化实践
kubernetes 亲和、反亲和、污点、容忍
golang's time package: methods for time interval formatting and output of timestamp formats such as seconds, milliseconds, and nanoseconds
使用TinkerPop框架对GDB增删改查
pytorch basic operations: classification tasks using neural networks
25K test old bird's 6-year experience in interviews, four types of companies, four types of questions...
JUC(二)原子类:CAS、乐观锁、Unsafe和原子类
51单片机外设篇:点阵式LCD
165.比较版本号
leetcode每天5题-Day04
LeetCode brush topic series - 787 K station transfer within the cheapest flight
Redis(十一) - 异步优化秒杀
网安学习-内网渗透4
Integrate ssm (1)
区块元素、内联元素(<div>元素、span元素)
Redis数据库
[PSQL] 窗口函数、GROUPING运算符
目标检测重要概念——IOU、感受野、空洞卷积、mAP
Redis-cluster mode (master-slave replication mode, sentinel mode, clustering mode)
上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展