命名规范

驼峰式命名法
camel 驼峰式命名法,又叫小驼峰式命名法(所以自然就存在大驼峰命名法啦……)。

驼峰式命名法要求第一个单词首字母小写,后面其他单词首字母大写。[中间不需要空格 - _等分割符]

帕斯卡命名法
Pascal 帕斯卡命名法,又叫大驼峰式命名法。

与小驼峰式命名法的最大区别在于,每个单词的第一个字母都要大写。[中间不需要空格 - _等分割符]

下划线命名法
下划线命名法并不如大小驼峰式命名法那么备受推崇,但是也是浓墨重彩的一笔。尤其在宏定义和常量中使用比较多,通过下划线来分割全部都是大写的单词。

该命名规范,也是很简单,要求单词与单词之间通过下划线连接即可。
lower_case_with_underscores
UPPER_CASE_WITH_UNDERSCORES
Capitalized_Words_With_Underscores (ugly!)

匈牙利命名法
匈牙利命名法是早期的规范,由微软的一个匈牙利人发明的,是 IDE 还十分智障的年代的产物,估计现在已经没啥人用了吧……一个十分系统却又琐碎的命名规范。

该命名规范,要求前缀字母用变量类型的缩写,其余部分用变量的英文或英文的缩写,单词第一个字母大写。

Class Names
Class names should normally use the CapWords/CamelCase convention.
CamelCase

Method Names and Instance Variables
Method names should be lowercase, with words separated by underscores as necessary to improve readability.
lower_case_with_underscores

Constants
Constants are usually defined on a module level and written in all capital letters with underscores separating words.
UPPER_CASE_WITH_UNDERSCORES

Function and Variable Names
Function names should be lowercase, with words separated by underscores as necessary to improve readability.
lower_case_with_underscores

你可能感兴趣的:(devops)