Commons Programming Case Types
Naming convention in programming is considered one of the hardest things. Today we will learn the different and most common types which are used in Programming.
- Camel Case
- Snake Case
- Kebab Case
- Pascal Case
- Upper Case
Camel Case
Camel Case must start with a lowercase letter and the first letter of every new subsequent word must have the first letter capitalized.
Example :(Camel case condition = camelCaseCondition)
const camelCaseCondition = true
Snake Case
In sake case all the spaces are replaced with ‘_’ and lowercasing all the words.
Example: (snake case condition = snake_case_condition)
const snake_case_condition = true
Kebab Case
In Kebab case all the spaces are replaced with ‘-‘ and lowercasing all the words.
Example: (kebab Case Condition = kebab-case-condition)
const kebab-case-condition = true
Pascal Case
In Pascal case, every word starts with the uppercase letter and eliminating the space.
Example :(pascal case = PascalCase)
const PascalCase = true
Upper case (with snake case)
Here, all the spaces are replaced with ‘_’ and converting all the letters to Uppercase.
Example: upper case = UPPER_CASE
const UPPER_CASE = true
Comparison table
Original string | This is test |
Camel Case | thisIsTest |
Snake Case | this_is_test |
Kabab Case | this-is-test |
Pascal Case | ThisIsTest |
UpperCase(with snake Case) | THIS_IS_TEST |
This above mentioned are the most common programming types.