Member-only story
What are different Naming conventions in Programming !!!
There are different naming conventions
in programming languages to define variables or other resources. Sometimes two or more words are required to properly interpret a resource’s meaning. However, most programming languages don’t allow spaces between words. Camel, pascal, kebab, and snake case are all naming conventions that are used in computer programming to be able to create compound names for variables, types, functions, classes, and other structures in source code.
Some of the benefits that naming conventions:
- Consistency.
- Better understanding.
- Readability.
Camel Case:🐫
In the camel case, we capitalize all the words after the first one
Example: fisrtName,lastName, birthDate and userAge.
Pascal case: follows the same camel case naming convention rules — all but one: we capitalize the first letter
Example: FisrtName,LastName, BirthDate and UserAge.
Snake Case: 🐍
In the snake case, we add an underscore between two words.
Example: fisrt_name,last_name, birth_date and user_age.
kebab case :
In the kebab case, we add a dash between two words. However many programming languages interpret the dash as a minus sign, and it unintentionally creates software bugs that are difficult to troubleshoot. So we need to be careful if we are deciding to choose to opt for the kabab case.
Example: fisrt-name,last-name, birth-date and user-age.