当前位置:网站首页>C# 编码规范手册
C# 编码规范手册
2022-08-02 05:17:00 【淡定九号】
C# 编码规范手册
引言
目的
明确C#编写的源程序和测试程序都符合相同的规范,达到一致性与统一性,以便于程序的后期维护和变更。
一个软件的生命周期中,80%的花费在于维护。几乎没有任何一个软件,在其整个生命周期中,均由最初的开发人员来维护;
编码规范可以改善软件的可读性,可以让程序员尽快而彻底地理解新的代码。为了执行规范,每个软件开发人员必须一致遵守编码规范;
使用统一编码规范的主要原因,是使应用程序的结构和编码风格标准化,以便于阅读和理解这段代码;
好的编码约定可使源代码严谨、可读性强且意义清楚,与其它语言约定相一致,并且尽可能的直观。
说明:编码规范是为了增加代码的可读性,没有所谓的对错,不必纠结于那样写对还是错。
术语定义
- Pascal 命名法:将标识符的首字母和后面连接的每个单词的首字母都大写。可以对三字符或更多字符的标识符使用 Pascal 大小写。例如: BackColor。
- Camel 命名法:标识符的首字母小写,而每个后面连接的单词的首字母都大写。例如: backColor。
- 大写:标识符中的所有字母都大写。仅对于由两个或者更少字母组成的标识符使用该约定。例如:System.IO,System.Web.UI。
- 文档的规范分为三种:【强制】【推荐】【参考】,表示规范需要遵循的级别
- 匈牙利命名法:匈牙利命名法是一种
边栏推荐
- nacos registry
- [C language] LeetCode26. Delete duplicates in an ordered array && LeetCode88. Merge two ordered arrays
- 网安学习-内网渗透4
- eggjs controller层调用controller层解决方案
- 5款经典代码阅读器的使用方案对比
- Brush LeetCode topic series - 10. Regular expression match
- 国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
- MySQL数据表的基本操作和基于 MySQL数据表的基本操作的综合实例项目
- Say good woman programmers do testing have an advantage?More than a dozen interview, abuse of cry ~ ~ by the interviewer
- 深度学习——CNN实现MNIST手写数字的识别
猜你喜欢

点云旋转到参考坐标系方向(最小方向包围盒方法)

Install and use Google Chrome

目标检测重要概念——IOU、感受野、空洞卷积、mAP

The Go language learning notes - dealing with timeout - use the language from scratch from Context
![[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

腾讯大咖分享 | 腾讯Alluxio(DOP)在金融场景的落地与优化实践

nacos注册中心

C语言中i++和++i在循环中的差异性

Redis集群模式

51单片机外设篇:点阵式LCD
随机推荐
BGP experiment (route reflector, federation, route optimization)
区块元素、内联元素(<div>元素、span元素)
leetcode一步解决链表合并问题
无代码生产新模式探索
25K测试老鸟6年经验的面试心得,四种公司、四种问题…
Introduction to coredns
国际顶会OSDI首度收录淘宝系统论文,端云协同智能获大会主旨演讲推荐
51单片机外设篇:点阵式LCD
【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
Different ways of shell scripting
Redis-cluster mode (master-slave replication mode, sentinel mode, clustering mode)
[OpenCV from entry to practice] image processing technology [pixel] (the most detailed in the whole network)
18 years of programmer career, read more than 200 programming books, pick out some essence to share with you
洛谷小游戏大全(用洛谷的人都得知道)
Features and installation of non-relational database MongoDB
关于web应用的目录结构
leetcode括号匹配问题——32.最长有效括号
Home NAS server (4) | MergerFS and SnapRaid data backup
How to perform concurrent calculation (stability test and stress test)?
TikTok平台的两种账户有什么区别?