Ever wondered why ‘Apple’ starts with upper case ‘A’ when it's the first word while writing a sentence? It's because there are some rules in the English language that every writer should follow. The rule is the first word of a sentence is always capitalized irrespective of what the word is.
Do you think coders also follow rules while writing code in programming language? Find out now as 98thPercentile reveals tips and secrets to young developers and assists them in acing their coding journey. Let's understand with Camel casing.
What is Camel Case?
Camel case is a type of writing style in which each word in a compound word is capitalized except for the first word. This style is most used in programming and web development for variables, functions, and other elements. It is widely used by developers because it is easy to read and understand.
Example: bunchOfBooks
Begin Your Child's Coding Adventure Now!
Decoding the meaning of Camel Case:
Camel case is named after humps of camel because of its extended capital letters just like humps of common camels. These camel cases are of two styles:
- Lower case: The first letter of the first word in a compound word is not capitalized.
- Upper case: The first letter of each word other than the first word is capitalized.
Examples:
1. numberOfBooks
2. favouritePhrase
3. dateOfBirth
4. lastName
5. LoginStatus
FAQ’s (Frequently Asked Questions)
Q.1. Is Camel case used in all programming languages?
Ans: No, not all programming languages use Camel case.
Q.2. Is Camel case used in Java?
Ans: Yes, Camel case is used in Java and JavaScript.
Q.3. Why is it called Camel case?
Ans: The capital letters in the middle of the word resemble a hump on camel back.
Q.4. Where can I use the Camel case?
Ans: Camel case is used in variables, functions, database columns, and classes.
Q.5. What is Camel case in programming?
Ans: Camel case is a type of writing where one compound word is written without spaces and the first letter in the first word is not capitalized.
Book 2-Week Coding Trial Classes Now!