Camel case

Camel case is named after the "hump" of its protruding capital letter, similar to the hump of common camels.

Camel case (sometimes stylized autologically as camelCase or CamelCase, also known as camel caps or more formally as medial capitals) is the practice of writing phrases without spaces or punctuation and with capitalized words. The format indicates the first word starting with either case, then the following words having an initial uppercase letter. Common examples include YouTube,[1] PowerPoint, HarperCollins, FedEx, iPhone, eBay,[2] and LaGuardia.[3] Camel case is often used as a naming convention in computer programming. It is also sometimes used in online usernames such as JohnSmith, and to make multi-word domain names more legible, for example in promoting EasyWidgetCompany.com. In fact, WikiWikiWeb, an ancestor of Wikipedia, is written in camel case.

The more specific terms Pascal case and upper camel case refer to a joined phrase where the first letter of each word is capitalized, including the initial letter of the first word. Similarly, lower camel case (also known as dromedary case) requires an initial lowercase letter. Some people and organizations, notably Microsoft, use the term camel case only for lower camel case, designating Pascal case for the upper camel case.[4] Some programming styles prefer camel case with the first letter capitalized, others not.[5][4][6] For clarity, this article leaves the definition of camel case ambiguous with respect to capitalization, and uses the more specific terms when necessary.

Camel case is distinct from several other styles: title case, which capitalizes all words but retains the spaces between them; Tall Man lettering, which uses capitals to emphasize the differences between similar-looking product names such as predniSONE and predniSOLONE; and snake case, which uses underscores interspersed with lowercase letters (sometimes with the first letter capitalized). A combination of snake and camel case (identifiers Written_Like_This) is recommended in the Ada 95 style guide.[7]

  1. ^ Fogarty, Mignon (27 October 2009). The Grammar Devotional: Daily Tips for Successful Writing from Grammar Girl. St. Martin's Publishing Group. p. 14. ISBN 978-1-4299-6440-1.
  2. ^ Brown, Adam (21 September 2018). Understanding and Teaching English Spelling: A Strategic Guide. Routledge. pp. 173–174. ISBN 978-1-351-62186-1.
  3. ^ Dreyer, Benjamin (4 August 2020). Dreyer's English: An Utterly Correct Guide to Clarity and Style. Random House Publishing Group. p. 228. ISBN 978-0-8129-8571-9.
  4. ^ a b "Capitalization Styles - .NET Framework 1.1". 17 November 2006. Retrieved 5 December 2012.
  5. ^ "Naming Conventions". Scala. Retrieved 5 December 2012.
  6. ^ "Camel Case". Retrieved 10 March 2016.
  7. ^ "Ada 95 Quality and Style Guide". October 1995. Section 3.1.3. Retrieved 25 January 2020.