In general, there are four common case styles.
camelCase
PascalCase
snake_case
kebab-case
Etymology of first, third and fourth styles are trivial. But what about second one (i.e. PascalCase)?
According to wikitionary,
Etymology
Referring to the Pascal programming language.
and the link only says
Letter case is ignored in Pascal source.
According to Free Pascal wiki,
Rules for identifiers:
- Must begin with a letter from the English alphabet or an underscore (_).
- Can be followed by alphanumeric characters (alphabetic characters and numerals), or the underscore (_).
- May not contain special characters, such as: ~ ! @ # ...
(snip)
Pascal is not case sensitive!
MyProgram
,MYPROGRAM
, andmYpRoGrAm
are equivalent. But for readability purposes, it is a good idea to use meaningful capitalization!There are two possible methods you could choose to apply to your identifiers: CamelCase and underscore as space. CamelCase, as it appears, means that separate words in an identifier are capitalized, so that you have
newPerson
orNewPerson
instead ofnewperson
. Using underscore as space means you separate words in an identifier with underscores, so that you havenew_person
instead ofnewperson
. Or you could combine the two, so that you havenew_Person
orNew_Person
instead ofnewperson
.
, which implies it is not required to use a camel-case identifier such as StackOverflow
or RedHatLinux
.
Then, where does the word "camel case" come from? Did pascal programmers first started using PascalCase style?
UpperCamelCase
to describe what you callPascalCase
.