Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camel case and Pascal case mistake

I constantly forget which is Camel case and which is Pascal case. So I thought that maybe a little history will help. Where do the names of these conventions come from? Is there some history behind their names?

like image 897
johny Avatar asked Jan 20 '17 16:01

johny


People also ask

What is the difference between camel case and Pascal case?

Camel case and Pascal case are similar. Both demand variables made from compound words and have the first letter of each appended word written with an uppercase letter. The difference is that Pascal case requires the first letter to be uppercase as well, while camel case does not.

What's the opposite of CamelCase?

When multiple words are used to form a variable, camel case joins those words together, without any white space, and delineates the start of each new word with a capital letter. In contrast, snake case uses an underscore between words to create separation.

What is CamelCase example?

Meaning of camel case in English. the use of a capital letter to begin the second word in a compound name or phrase, when it is not separated from the first word by a space: Examples of camel case include "iPod" and "GaGa".

Why camel case is the best?

Results indicate that camel casing leads to higher accuracy among all subjects regardless of training, and those trained in camel casing are able to recognize identifiers in the camel case style faster than identifiers in the underscore style.


2 Answers

To remember camel case you have to think about the shape of the capital letters. They are like the humps of a camel as you can see in this image.

Pascal Casing - capitalizes each word:

ThisShouldBePascalCase

Camel Casing - is similiar to pascal case but the first word is not capitalized:

thisShouldBeCamelCase

You can read some history here

UPDATE: Change the camel case image after reading the comments.

like image 76
Ema.jar Avatar answered Sep 28 '22 01:09

Ema.jar


Pascal is a persons name... a persons name always starts capitalized, whereas 'camel' is just a noun and thus, unless the start of a sentence, is always lowercased.

like image 41
Yoeri Van Nieuwerburg Avatar answered Sep 28 '22 02:09

Yoeri Van Nieuwerburg