Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

For the purposes of communicating coding styles to my co-workers, what would I formally call the following variants of camel case?

camelCase

and

CamelCase

Notice that the former version starts with a lower-case alphabetic character, and the latter version starts with an upper-case alphabetic character.

I assume these have some sort of "official name".

Also if there are any other forms I have not listed here, bonus points to those that mention them as well as well as their names.

share|improve this question
4  
Only the first one is called "camel case". The latter is called "pascal case" –  good_computer Apr 6 '12 at 15:58
add comment

3 Answers

up vote 6 down vote accepted

The first is Camel Case and the second is Pascal Case.

Capitalization Conventions at MSDN

To differentiate words in an identifier, capitalize the first letter of each word in the identifier. Do not use underscores to differentiate words, or for that matter, anywhere in identifiers. There are two appropriate ways to capitalize identifiers, depending on the use of the identifier:

  • PascalCasing
  • camelCasing

The PascalCasing convention, used for all identifiers except parameter names, capitalizes the first character of each word (including acronyms over two letters in length), as shown in the following examples:

PropertyDescriptor
HtmlTag

A special case is made for two-letter acronyms in which both letters are capitalized, as shown in the following identifier:

IOStream

The camelCasing convention, used only for parameter names, capitalizes the first character of each word except the first word, as shown in the following examples. As the example also shows, two-letter acronyms that begin a camel-cased identifier are both lowercase.

propertyDescriptor
ioStream
htmlTag

√ DO use PascalCasing for all public member, type, and namespace names consisting of multiple words.

√ DO use camelCasing for parameter names...

share|improve this answer
1  
I prefer the discussion version History around Pascal Casing and Camel Casing –  Joshua Drake Apr 6 '12 at 16:02
add comment

http://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles

  • CapitalizedWords
  • mixedCase

See also snake_case

share|improve this answer
1  
would you mind explaining more on what it does and why do you recommend it as answering the question asked? "Link-only answers" are not quite welcome at Stack Exchange –  gnat Sep 3 '13 at 11:40
    
@gnat, my answer is "CapitalizedWords and mixedCase". The link is the justification. –  Vorac Sep 3 '13 at 12:45
    
And I posted it as the whole URL and not just a link for a couple of reasons, despite the knee-jerk reflex of many SE-ers that a link in a short answer automatically means a "link-only answer" - downvote and move on. First, to emphasize this is the python community's idea, and second to emphasize this is from the de-facto standard coding style guide. Explaining the same in a long paragraph like this one would have been much less clear IMO. –  Vorac Sep 4 '13 at 8:36
add comment

I use the terms "lower camel case" and "upper camel case", but "Pascal Case" is also correct (or perhaps "more" correct, eh).

Refer here: http://c2.com/cgi/wiki?UpperCamelCase

A naming convention, also known as PascalCase, in which several words are joined together, and the first letter of every word is capitalized. Contrast this with LowerCamelCase, in which the first letter of the entire word is lowercase, but subsequent first letters are uppercase...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.