Aus*_*art 41 naming camelcasing case
我对不同类型的标识符案例感兴趣,以及人们称之为什么.您是否知道此列表或其他替代名称的任何添加内容?
Sha*_*uti 15
myvariable
my-variable
这是最著名的。其他名称包括:毛毛虫案例,破折号案例,连字符案例,口齿不清案例,脊椎案例和css案例)myVariable
MyVariable
其他名称:大驼峰案)my_variable
其他名称:c皮套)MY_VARIABLE
其他名称:大写)COBOL-CASE
其他名称:火车箱)Nil*_*rth 14
名称要么是通用的,要么是语言,要么是丰富多彩的; 大多数人没有特定社区之外的标准名称.
这些命名约定有很多名称(名称的名称!); 请参阅命名约定:多字标识符,尤其是CamelCase(UpperCamelCase,lowerCamelCase).但是,许多人没有标准名称.考虑Python样式指南PEP 0008 - 它通过诸如"lower_case_with_underscores"之类的通用名称来调用它们.
一种惯例是以众所周知的用途命名.这导致:
...并建议这些名称,这些名称并未广泛使用:
或者,有说明性名称,其中最好的名称是CamelCase.snake_case是最近的(2004年),但现在已经很成熟了.kebab-case是最新的,仍然没有建立,可能起源于Stack Overflow!(以破折号分隔的案例的名称是什么?)还有更多色彩缤纷的建议,如caterpillar_case,Train-case,caravan-case等.
小智 8
MyVariable
: Pascal Case
=> 用于Class
myVariable
: Camel Case
=> 用于variable
Java、C# 等。
myvariable
: Flat Case
=> 用于package
Java 等。
my_variable
: Snake Case
=> 用于variable
Python、PHP 等。
my-variable
: Kebab Case
=> 用于css
+--------------------------+-------------------------------------------------------------+
| Formatting | Name(s) |
+--------------------------+-------------------------------------------------------------|
| namingidentifier | flat case/Lazy Case |
| NAMINGIDENTIFIER | upper flat case |
| namingIdentifier | (lower) camelCase, dromedaryCase |
| NamingIdentifier | (upper) CamelCase, PascalCase, StudlyCase, CapitalCamelCase |
| naming_identifier | snake_case, snake_case, pothole_case, C Case |
| Naming_Identifier | Camel_Snake_Case |
| NAMING_IDENTIFIER | SCREAMING_SNAKE_CASE, MACRO_CASE, UPPER_CASE, CONSTANT_CASE |
| naming-identifier | Kebab Case/caterpillar-case/dash-case, hyphen-case, |
| | lisp-case, spinal-case and css-case |
| NAMING-IDENTIFIER | TRAIN-CASE, COBOL-CASE, SCREAMING-KEBAB-CASE |
| Naming-Identifier | Train-Case, HTTP-Header-Case |
| _namingIdentifier | Undercore Notation (prefixed by "_" followed by camelCase |
| datatypeNamingIdentifier | Hungarian Notation (variable names Prefixed by metadata |
| | data-types which is out-dated) |
|--------------------------+-------------------------------------------------------------+
Run Code Online (Sandbox Code Playgroud)