Naming Convention Camel Case, Kebab Case & Snake Case

What are the variable naming conventions defined while coding? Rules for variable names formed by combinations of 2 or more words;
Naming Convention | Format |
---|---|
Camel Case (Lower Camel Case, Dromedary Case) | camelCase |
Kebab Case (Dash Case, Lisp Case, Spinal Case) | kebab-case |
Snake Case (Pothole Case) | snake_case |
Pascal Case (Upper Camel Case, Studly Case) | PascalCase |
Flat Case | flatcase |
Upper Flat Case | UPPERFLATCASE |
Screaming Snake Case (Macro Case, Constant Case) | SCREAMING_SNAKE_CASE |
Camel Snake Case | camel_Snake_Case |
Pascal Snake Case | Pascal_Snake_Case |
Train Case (HTTP Header Case) | Train-Case |
Cobol Case (Screaming Kebab Case) | COBOL-CASE |
Naming Convention
Camel Case
It is also known as camel case, lower camel case and dromedary case, which is one of the most used variable definition formats.
The first letter of the first word of the variable name to be formed by the combination of 2 or more words is written adjacently, with the first letter of the second word capitalized.
The variant created is called camel case because it resembles a camel’s back in shape.
let juniorToExpert
Kebab Case
It is also known as kebab case, dash case, lisp case, spinal case, which is another common naming convention structure.
It is written by separating the words of the variable name to be created with a “-” character.
This structure is called kebab case because it resembles a kebab with a bottle. This structure has multiple names, but it is most commonly known as the kebab case.
let junior-to-expert
Snake Case
Another widely used code convention structure, the snake case is also known as the pothole case.
It is written by separating the words or characters that will make up the variable name with a “_” character.
let junior_to_expert
Flat Case
Flat case is a variable convention structure created by combining the characters or words that make up the variable with lowercase letters as they are.
let juniortoexpert
Pascal Case
It is formed by combining the words that make up the variable side by side so that the first letters are capitalized. Although more commonly known as pascal case, it is also known as upper camel case and studly case.
let JuniorToExpert
Upper Flat Case
It is formed by using all letters of the words as capital letters and combining them while defining the variable.
let JUNIORTOEXPERT
Screaming Snake Case
It is formed by using all capital letters of the words that make up the variable name and combining them with an underscore (_). Although it is generally known as the screaming snake case, it is also known as the macro case and constant case.
let JUNIOR_TO_EXPERT
Camel Snake Case
The camel snake case, which is a combination of the snake case and camel case rules, is formed by using the first letter of the first word of the words that make up the variable, lowercase the first letter of the other words, and separating these words with an underscore (_).
let junior_To_Expert
Pascal Snake Case
Pascal snake case, which is formed by the combination of snake case and pascal case rules, is formed by capitalizing the first letters of the words that make up the variable and separating these words with an underscore (_).
let Junior_To_Expert
Train Case
The train case, which is formed by the combination of kebab case and pascal case rules, is also known as HTTP header case. It is formed by capitalizing the first letters of the words that make up the variable and separating these words with a hyphen (-).
let Junior-To-Expert
Cobol Case
The cobol case, which is a combination of the upper flat case and the kebab case rules, is also known as the screaming kebab case. The words that make up the variable name are all capitalized and separated by a hyphen (-).
let JUNIOR-TO-EXPERT
Using Naming Conventions in Software Languages
Swift Naming Convention
Camel case, pascal case
Kotlin Naming Convention
Camel case
Source:
https://en.wikipedia.org/wiki/Naming_convention_(programming)