大小写
- 分类
- camelCase: 首单词首字母小写,其余单词首字母大写
- PascalCase:所有单词首字母大写
- _camelCase:camelCase前加下划线
- 扩展阅读
- https://github.com/ktaranov/naming-convention/blob/master/C%23%20Coding%20Standards%20and%20Naming%20Conventions.md
- https://www.c-sharpcorner.com/UploadFile/8a67c0/C-Sharp-coding-standards-and-naming-conventions/
- https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/general-naming-conventions
示例(大小写)
- 私有字段: _camelCase|camelCase
- 本地变量|参数: camelCase
- 缩写特例:camelCase(2字母 ex. UIControl uiControl),PascalCase(3+字母 ex.FtpTransfer ftpTransfer)
- 接口特例:IPascalCase
- 其余:PascalCase(含protected)
词性
- 空间名|类名:名词,相当于主语;ex. System.Console
- 方法|过程:动词,相当于宾语;ex. Write()
- 接口名:名词|形容词; ex. IEnumerable
网友评论