What is the Camel case? Types of camel cases Explained 2021.
What is the Camel case?
camel case is a writing practice where the phrase is written without any space or punctuation, a capital letter (Upper case) is used to separate words. The first letter of the first word can be a capital letter (Upper case) or it can also be a small letter (lower case).
Camel case is a naming convention. It is also called camel caps. Mostly it is used in computer programming.
Example: HelloWorld, IndianPeoples, getPeople, GoToClassRoom
The above word is written in CamelCase. You can write anything you want. The name of many companies is spelled as CamelCase such as MasterCard, PowerPoint, StarCraft, WorldWideWeb, LaserJet etc.
How many types of camel cases are there?
It is of two types.
1.) upper CamelCase :
In this, the first letter of the first word is capitalized, after that, the first letter of the word is also capital. It is also called the Pascal case.
Example: YouTube, WordPress
2.) lower camelCase :
In this, the first letter of the first word is small, after that the first letter of the word is capital (large). It is also called the dromedary case.
Example : getHelp , eBay , iPhone , getName
Where is the camel case used?
The camel case is mostly used in programming. Where whenever we write the name of the class or the name of the function, then the camel case is used.
In programming, whenever the name of a function or a class or a variable name is too long, we separate the words with ” – ” or ” _ “, it does not look good, so we use camel case When we use it, it is also good in appearance and due to this, the meaning of the whole world is also understood well.
Example: To define a function: function getHelp(), function getTotal()
To define class: class StudentDetail , class FacebookNameIdentifier()
Any website such as Facebook, Twitter, Instagram, Reddit, or any other website, all these websites have to choose a username, then we choose our name using camel case so that we can remember the name.
Example: markZuckBerg, RaviRaushan, johnnyDepp, superManIndia
Most of the time only the lower camel case is used.