Table of contents
1. Code style specification
1.1. Introduction
Various programming languages emerge in endlessly, and the coding style specifications of various languages are also different. The mainstream code style specifications are: camel case
, snake case
, kebab case
.
1.2. Code style
1.2.1. camel case (hump type)
In camel case named names, the words are directly connected, except for the first word, the first letter of the following words is all capitalized.
- If the first word is capitalized, it is called
CamelCase
(UpperCamelCase). - If the first letter of the word is lowercased, it is called
camelCase
(little camel case).
1.2.2. snake case (snake style)
In snake case names, use _
to separate adjacent words.
- If all words are lowercase, it is called
lower_snake_case
(little snake style). - If all words are capitalized, it is called
UPPER_SNAKE_CASE
(Oroza style).
1.2.3. kebab case (kebab style)
In kebab case-style naming, use -
to separate adjacent words, and all words are lowercase.