当前位置:网站首页>C# 编码规范手册
C# 编码规范手册
2022-08-02 05:17:00 【淡定九号】
C# 编码规范手册
引言
目的
明确C#编写的源程序和测试程序都符合相同的规范,达到一致性与统一性,以便于程序的后期维护和变更。
一个软件的生命周期中,80%的花费在于维护。几乎没有任何一个软件,在其整个生命周期中,均由最初的开发人员来维护;
编码规范可以改善软件的可读性,可以让程序员尽快而彻底地理解新的代码。为了执行规范,每个软件开发人员必须一致遵守编码规范;
使用统一编码规范的主要原因,是使应用程序的结构和编码风格标准化,以便于阅读和理解这段代码;
好的编码约定可使源代码严谨、可读性强且意义清楚,与其它语言约定相一致,并且尽可能的直观。
说明:编码规范是为了增加代码的可读性,没有所谓的对错,不必纠结于那样写对还是错。
术语定义
- Pascal 命名法:将标识符的首字母和后面连接的每个单词的首字母都大写。可以对三字符或更多字符的标识符使用 Pascal 大小写。例如: BackColor。
- Camel 命名法:标识符的首字母小写,而每个后面连接的单词的首字母都大写。例如: backColor。
- 大写:标识符中的所有字母都大写。仅对于由两个或者更少字母组成的标识符使用该约定。例如:System.IO,System.Web.UI。
- 文档的规范分为三种:【强制】【推荐】【参考】,表示规范需要遵循的级别
- 匈牙利命名法:匈牙利命名法是一种
边栏推荐
- C语言基础知识梳理总结:零基础入门请看这一篇
- Constructors, member variables, local variables
- 为什么4个字节的float要比8个字节的long大呢?
- Point Density-Aware Voxels for LiDAR 3D Object Detection 论文笔记
- leetcode括号匹配问题——32.最长有效括号
- coredns介绍
- 深度学习——CNN实现MNIST手写数字的识别
- flex布局(弹性布局)
- Cyber Security Learning - Intranet Penetration 4
- Mysql数据库 | 基于Docker搭建Mysql-8.0以上版本主从实例实战
猜你喜欢
无代码生产新模式探索
BGP experiment (route reflector, federation, route optimization)
Thread Basics (1)
eggjs controller层调用controller层解决方案
淘系资深工程师整理的300+项学习资源清单(2021最新版)
Review: image saturation calculation formula and image signal-to-noise (PSNR) ratio calculation formula
Say good woman programmers do testing have an advantage?More than a dozen interview, abuse of cry ~ ~ by the interviewer
制作web3d动态产品展示的优点
C语言基础知识梳理总结:零基础入门请看这一篇
[PSQL] window function, GROUPING operator
随机推荐
Luogu mini game Daquan (everyone who uses Luogu must know)
Redis(十一) - 异步优化秒杀
机器学习——支持向量机原理
PSQL function, predicate, CASE expression and set operations
5款经典代码阅读器的使用方案对比
The Go language learning notes - dealing with timeout - use the language from scratch from Context
kubernetes affinity, anti-affinity, taint, tolerance
Redis-----非关系数据库
Polar Parametrization for Vision-based Surround-View 3D Detection Paper Notes
C语言入门实战(13):十进制数转二进制
双重for循环案例(用js打印九九乘法表)
leetcode括号匹配问题——32.最长有效括号
There are more and more talents in software testing. Why are people still reluctant to take the road of software testing?
How to perform concurrent calculation (stability test and stress test)?
Contents of encoding-indexes.js file printed with Bluetooth:
18 years of programmer career, read more than 200 programming books, pick out some essence to share with you
golang's time package: methods for time interval formatting and output of timestamp formats such as seconds, milliseconds, and nanoseconds
洛谷小游戏大全(用洛谷的人都得知道)
selenium + robotframework的运行原理
Linux CentOS8安装Redis6