World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0000006698
Reproduction Date:

Title: CamelCase  
Author: World Heritage Encyclopedia
Language: English
Subject: Snake case, History of wikis, Epguides, Hungarian notation, Interwiki links
Publisher: World Heritage Encyclopedia


A two humped camel that illustrates the idiom.

CamelCase (camel case, camel caps or medial capitals) is the practice of writing compound words or phrases such that each next word or abbreviation begins with a capital letter. Camel case may start with a capital or, especially in programming languages, with a lowercase letter. Common examples are PowerPoint or iPhone.

In Microsoft documentation, camel case always starts with a lower case letter (e.g. backColor), and it is contrasted with Pascal case which always begins with a capital letter (e.g. BackColor).[1]

Variations and synonyms

Although the first letter of a camel case compound word may or may not be capitalized, the term camel case generally implies lowercase first letter.[2][3] For clarity, this article calls the two alternatives upper camel case and lower camel case. Some people and organizations use the term camel case only for lower camel case. Other synonyms include:

StudlyCaps encompasses all such variations,[4] and more, including even random mixed capitalization, as in MiXeD CaPitALiZaTioN (typically a stereotyped allusion to online culture).

Camel case is also distinct from title case, which is traditionally used for book titles and headlines. Title case capitalizes most of the words yet retains the spaces between the words.[19][20][21] Camel case is also distinct from Tall Man lettering, which uses capitals to emphasize the differences between similar-looking words.


Chemical formulae

The first systematic and widespread use of medial capitals for technical purposes was the notation for chemical formulae invented by the Swedish chemist Berzelius in 1813. To replace the multitude of naming and symbol conventions used by chemists until that time, he proposed to indicate each chemical element by a symbol of one or two letters, the first one being capitalized. The capitalization allowed formulae like 'NaCl' to be written without spaces and still be parsed without ambiguity.[22][23]

Berzelius's system remains in use to this day, augmented with three-letter symbols like 'Et' for 'ethyl-'). This has been further extended to describe the amino acid sequences of proteins and other similar domains.

The King's English

In their English style guide F. G. Fowler suggested that medial capitals could be used in triple compound words where hyphens would cause ambiguity—the examples they give are "KingMark-like" (as against "King Mark-like") and "Anglo-SouthAmerican" (as against "Anglo-South American"). However, they described the system as "too hopelessly contrary to use at present."[24]

Early use in trademarks

Since the early 20th century, medial capitals have occasionally been used for corporate names and product trademarks, such as

Computer programming

In the 1970s and 1980s, medial capitals were adopted as a standard or alternative naming convention for multi-word identifiers in several programming languages. The origin of this convention has not yet been settled. However, a 1954 conference proceedings[27] informally referred to IBM's Speedcoding system as "SpeedCo". Christopher Strachey's paper on GPM (1965),[28] shows a program that includes some medial capital identifiers, including "NextCh" and "WriteSymbol".

Background: multi-word identifiers

Computer programmers often need to write descriptive (hence multi-word) identifiers, like end of file or char table, in order to improve the readability of their code. However, most popular programming languages forbid the use of spaces inside identifiers, since they are interpreted as delimiters between tokens, and allowing spaces inside of identifiers would significantly complicate lexical analysis (breaking the source code into tokens). The alternative of writing the words together as in endoffile or chartable is not satisfactory, since the word boundaries may be quite difficult to discern in the result or it may even be misleading (e.g. chartable may be used to mean chart-able, not "char table": something can be displayed in a chart).

Some early programming languages, notably Lisp (1958) and COBOL (1959), addressed this problem by allowing a hyphen ("-") to be used between words of compound identifiers, as in "END-OF-FILE"—Lisp because it worked well with prefix notation; a Lisp parser would not treat a hyphen in the middle of a symbol as a subtraction operator; COBOL because its operators were English words. This convention remains in use in these language, and is also common in program names entered at a command line, as in Unix.

However, this solution was not adequate for algebra-oriented languages such as FORTRAN (1955) and ALGOL (1958), which used the hyphen as an intuitively obvious subtraction operator, and did not wish to require spaces around the hyphen, so one could write a - b as a-b. These early languages instead allowed identifiers to have spaces in them, determining the end of the identifier by context; this was abandoned in later languages due to the complexity it adds to tokenization. In addition, common punched card character sets of the time were uppercase only and lacked other special characters. Further, FORTRAN initially restricted identifiers to six characters or fewer at the time, preventing multi-word identifiers except those made of very short words.

It was only in the late 1960s that the widespread adoption of the ASCII character set made both lower case and the underscore character _ universally available. Some languages, notably C, promptly adopted underscores as word separators; and underscore-separated compounds like end_of_file are still prevalent in C programs and libraries, as well as other languages such as Python. However, some languages and programmers chose to avoid underscores, among other reasons to prevent confusing them with whitespace, and adopted camel case instead. Two accounts are commonly given for the origin of this convention.

"Lazy programmer" theory

One theory for the origin of the camel case convention holds that C programmers and hackers simply found it more convenient than the snake case style (as in "this_is_an_example").

The underscore key is inconveniently placed on American QWERTY keyboards. Furthermore, early compilers severely restricted the length of identifiers (e.g., to 8 or 14 letters) or silently truncated all identifiers to that length (for example, FORTRAN 77 limited identifiers to 6 characters; even in C99, characters after the first 31 could be ignored).[29] Finally, the small size of computer displays available in the 1970s (e.g., 80-character by 24-line VT52 and similar terminals) encouraged the use of short identifiers. Some programmers opted to use camel case instead of underscores to get legible compound names with fewer keystrokes and fewer characters.

"Alto Keyboard" theory

Another account claims that the camel case style first became popular at Xerox PARC around 1978, with the Mesa programming language developed for the Xerox Alto computer. This machine lacked an underscore key, and the hyphen and space characters were not permitted in identifiers, leaving camel case as the only viable scheme for readable multiword names. The PARC Mesa Language Manual (1979) included a coding standard with specific rules for Upper- and lowerCamelCase that was strictly followed by the Mesa libraries and the Alto operating system.

The Smalltalk language, which was developed originally on the Alto and became quite popular in the early 1980s, may have been instrumental in spreading the style outside PARC. Camel case was also used by convention for many names in the PostScript page description language (invented by Adobe Systems founder and ex-PARC scientist John Warnock), as well as for the language itself. A further boost was provided by Niklaus Wirth (the inventor of Pascal) who acquired a taste for camel case during a sabbatical at PARC and used it in Modula, his next programming language.

Spread to mainstream usage

Whatever its origins within the computing world, the practice spread in the 1980s and 1990s, when the advent of the personal computer exposed hacker culture to the world. Camel case then became fashionable for corporate trade names, initially in technical fields; mainstream usage was well established by 1990:

During the dot-com bubble of the late 1990s, the lowercase prefixes "e" (for "electronic") and "i" (for "Internet",[31] "information", "intelligent", etc.) became quite common, giving rise to names like Apple's iMac and the eBox software platform.

In 1998, Dave Yost suggested that chemists use medial capitals to aid readability of long chemical names, e.g. write AmidoPhosphoRibosylTransferase instead of amidophosphoribosyltransferase.[32] This usage was still rare in 2012.

The practice is sometimes used for abbreviated names of certain neighborhoods, e.g. New York City neighborhoods SoHo (South of Houston Street) and TriBeCa (Triangle Below Canal Street) and San Francisco's SoMa (South of Market). Such usages erode quickly, so the neighborhoods are now typically rendered as Soho, Tribeca, and Soma.

Internal capitalization has also been used for other technical codes like HeLa (1983).

History of the name "camel case"

The original name of the practice, used in media studies, grammars and the Oxford English Dictionary, was "medial capitals". The fancier names such as "InterCaps", "CamelCase" and variations thereof are relatively recent and seem more common in computer-related communities.

The earliest known occurrence of the term "InterCaps" on Usenet is in an April 1990 post to the group alt.folklore.computers by Avi Rappoport,[8] with "BiCapitalization" appearing slightly later in a 1991 post by Eric S. Raymond to the same group.[33] The earliest use of the name "CamelCase" occurs in 1995, in a post by Newton Love.[34] "With the advent of programming languages having these sorts of constructs, the humpiness of the style made me call it HumpyCase at first, before I settled on CamelCase. I had been calling it CamelCase for years," said Love, "The citation above was just the first time I had used the name on USENET."[35]

The name "CamelCase" is not related to the "Camel Book" (Programming Perl), which uses all-lowercase identifiers with underscores in its sample code. However, in Perl programming CamelCase is also commonly used.

Current usage in computing

Programming and coding

The use of medial caps for compound identifiers is recommended by the Mesa, Pascal, Modula, Java and Microsoft's .NET) this practice is recommended by the language developers or by authoritative manuals and has therefore become part of the language's "culture".

Style guidelines often distinguish between upper and lower camel case, typically specifying which variety should be used for specific kinds of entities: variables, record fields, methods, procedures, types, etc. These rules are sometimes supported by static analysis tools that check source code for adherence.

The original Hungarian notation for programming, for example, specifies that a lowercase abbreviation for the "usage type" (not data type) should prefix all variable names, with the remainder of the name in upper camel case; as such it is a form of lower camel case.

Programming identifiers often need to contain acronyms and initialisms that are already in upper case, such as "old HTML file". By analogy with the title case rules, the natural camel case rendering would have the abbreviation all in upper case, namely "oldHTMLFile". However, this approach is problematic when two acronyms occur together (e.g., "parse DBM XML" would become "parseDBMXML") or when the standard mandates lower camel case but the name begins with an abbreviation (e.g. "SQL server" would become "sQLServer"). For this reason, some programmers prefer to treat abbreviations as if they were lower case words and write "oldHtmlFile", "parseDbmXml" or "sqlServer".

Wiki link markup

Camel case is used in some wiki markup languages for terms that should be automatically linked to other wiki pages. This convention was originally used in Ward Cunningham's original wiki software, WikiWikiWeb, and can be activated in most other wikis. Some wiki engines such as TiddlyWiki, Trac and PMWiki make use of it in the default settings, but usually also provide a configuration mechanism or plugin to disable it. WorldHeritage formerly used camel case linking as well, but switched to explicit link markup using square brackets and many other wiki sites have done the same. Some wikis that do not use camel case linking may still use the camel case as a naming convention, such as AboutUs.

Other uses

The NIEM registry requires that XML data elements use upper camel case and XML attributes use lower camel case.

Most popular command-line interfaces and scripting languages cannot easily handle file names that contain embedded spaces (usually requiring the name to be put in quotes). Therefore, users of those systems often resort to camel case (or underscores, hyphens and other "safe" characters) for compound file names like MyJobResume.pdf.

Microblogging and social networking sites that limit the number of characters in a message (most famously Twitter, where the 140-character limit can be quite restrictive in languages that rely on alphabets, including English) are potential outlets for medial capitals. Using CamelCase between words reduces the number of spaces, and thus the number of characters, in a given message, allowing more content to fit into the limited space.

In website URLs, spaces are percent-encoded as "%20", making the address longer and less human readable. By omitting spaces, CamelCase does not have this problem.

Current usage in natural languages

Camel case has been used in languages other than English for a variety of purposes, including the ones below:

Orthographic markings

Camel case is sometimes used in the transcription of certain scripts, to differentiate letters or markings. An example is the rendering of Tibetan proper names like rLobsang: the "r" here stands for a prefix glyph in the original script that functions as tone marker rather than a normal letter. Another example is tsIurku, a Latin transcription of the Chechen term for the capping stone of the characteristic Medieval defensive towers of Chechenia and Ingushetia; the capital letter "I" here denoting a phoneme distinct from the one transcribed as "i".

Inflection prefixes

Camel case may also be used when writing proper names in languages that inflect words by attaching prefixes to them. In some of those languages, the custom is to leave the prefix in lower case and capitalize the root.

This convention is used in Irish orthography as well as Scots Gaelic orthography; e.g., i nGaillimh ("in Galway"), from Gaillimh ("Galway"); an tAlbanach ("the Scottish person"), from Albanach ("Scottish person"); go hÉireann ("to Ireland"), from Éire ("Ireland).

Similarly, in transliteration of the Hebrew language, haIvri means "the Hebrew person" and biYerushalayim means "in Jerusalem".

This convention is also used by several Bantu languages (e.g., kiSwahili = "Swahili language", isiZulu = "Zulu language") and several indigenous languages of Mexico (e.g. Nahuatl, Totonacan, Mixe–Zoque and some Oto-Manguean languages).

In abbreviations and acronyms

Abbreviations of some academic qualifications are sometimes presented in camel case without punctuation, e.g. PhD or BSc.

In French, camel case acronyms such as OuLiPo (1960) were favored for a time as alternatives to initialisms.

Camel case is often used to transliterate initialisms into alphabets where two letters may be required to represent a single character of the original alphabet, e.g., DShK from Cyrillic ДШК.

Honorifics within compound words

In several languages, including English, adorarLo ("adore Him").

Other uses

In German nouns carry a grammatical gender—which, for roles or job titles, is felt usually as masculine. Since the feminist movement of the 1980s, some writers and publishers have been using the feminine title suffixes -in (singular) and -innen (plural) to emphasize the inclusion of females; but written with a capital 'I', to indicate that males are not excluded. Example: MitarbeiterInnen ("co-workers, male or female") instead of Mitarbeiter ("co-workers", masculine grammatical gender) or Mitarbeiterinnen ("female co-workers"). This use is analogous to the use of parentheses in English, for example in the phrase "congress(wo)man."

In German, the names to statutes are abbreviated using embedded capitals, e.g. StGB (Strafgesetzbuch) for criminal code, PatG (Patentgesetz) for Patent Act or the very common GmbH (Gesellschaft mit beschränkter Haftung) for Company with Limited Liability.


CamelCase has been criticised as negatively impacting readability due to the removing of spaces and upcasing of every word.[36] One natural language study found that replacing spaces between words with letters or digits made it harder to recognise individual words, which resulted in increased reading times.[37] However, a study that specifically compared under_score style and CamelCase found that camel case identifiers could be recognised with higher accuracy among both programmers and non-programmers, and that programmers already trained in CamelCase were able to recognise CamelCase identifiers faster than underscored identifiers.[38]

Another study with use of eye-tracking equipment, while results indicate no difference in accuracy between the two styles, subjects recognize identifiers in the underscore style more quickly.[39]

Use of CamelCase can conflict with the regular use of uppercase letters for all caps acronyms e.g. to represent a concept like "the TCP IP socket ID" the writer must choose to either retain the capitalisation of the acronyms ("TCPIPSocketID"), which harms readability, or to retain capitalisation of only the first letter ("TcpIpSocketId"), which makes it harder to recognise that a given word is intended as an acronym.[40] An alternative is to follow any instance of acronymic capitalization with a re-initialization of lower case camel, as TCPIPsocketID. This has the effect of enforcing the lower camel case standard.

See also


  1. ^ "Capitalization Styles". Microsoft. Retrieved 12 September 2013. 
  2. ^ "Naming Conventions". Scala. Retrieved 5 December 2012. 
  3. ^ "Capitalization Styles". Retrieved 5 December 2012. 
  4. ^ a b c Hayes, Brian (July–August 2006). "The Semicolon Wars". American Scientist Online: The Magazine of Sigma XI. The Scientific Research Society. art. pg. 2. 
  5. ^ C# Coding Standards and Guidelines at Purdue University College of Technology
  6. ^ "". Retrieved 4 June 2010. 
  7. ^ a b Style Guide for Python Code at
  8. ^ a b "compoundName". discussion thread at alt.folklore.computers. 29 March 1990. 
  9. ^ "[#APF-1088] If class name has embedded capitals, AppGen code fails UI tests and generated hyperlinks are incorrect. – AppFuse JIRA". Retrieved 4 June 2010. 
  10. ^ ASP Naming Conventions, by Nannette Thacker (05/01/1999)
  11. ^ Iverson, Cheryl, et al. (eds) (2007). AMA Manual of Style (10th ed.). Oxford, Oxfordshire: Oxford University Press.  
  12. ^ Christine A. Hult and Thomas N. Huckin. "The Brief New Century Handbook – Rules for internal capitalization". Pearson Education. 
  13. ^ "Brad Abrams : History around Pascal Casing and Camel Casing". 3 February 2004. Retrieved 4 January 2014. 
  14. ^ "Pascal Case". 27 September 2012. Retrieved 4 January 2014. 
  15. ^ "NET Framework General Reference Capitalization Styles". Retrieved 4 January 2014. 
  16. ^ "WikiWord < TWiki < TWiki". Retrieved 4 June 2010. 
  17. ^ "Wiki Case". 8 February 2010. Retrieved 4 June 2010. 
  18. ^ "String Utilities". 13 July 2007. 
  19. ^ Title Case in PHP at SitePoint Blogs
  20. ^ "WordTips: Intelligent Title Case. Retrieved 2014-04-24". Retrieved 2014-06-20. 
  21. ^ "How to: Change casing in Text to TitleCase – Jan Schreuder on .Net". 14 November 2006. Retrieved 4 January 2014. 
  22. ^ Jöns Jacob Berzelius (1813). Essay on the Cause of Chemical Proportions and on Some Circumstances Relating to Them: Together with a Short and Easy Method of Expressing Them. Annals of Philosophy 2, 443-454, 3, 51-52; (1814) 93-106, 244-255, 353-364.
  23. ^ Henry M. Leicester & Herbert S. Klickstein, eds. 1952, A Source Book in Chemistry, 1400-1900 (Cambridge, MA: Harvard)
  24. ^  
  25. ^ The Trade-mark Reporter (v. 20).  
  26. ^ MisteRogers" (1962)""". Retrieved 4 January 2014. 
  27. ^ Resume of Session 8". Digital Computers: Advanced Coding Techniques. Summer Session 1954, Massachusetts Institute of Technology, page 8-6.""" (PDF). Retrieved 4 January 2014. 
  28. ^  
  29. ^ ISO/IEC 9899:1999 specification. p. 20, § Translation limits. 
  30. ^ "". Retrieved 4 January 2014. 
  31. ^ Farhad Manjoo (30 April 2002). "Grads Want to Study on EMacs, Too". Retrieved 4 June 2010. 
  32. ^ Feedback, 20 June 1998 Vol 158 No 2139 New Scientist 20 June 1998
  33. ^ "The jargon file version 2.5.1 29 January 1991 follows in 15 parts – misc.misc | Google Groups". Retrieved 23 May 2009. 
  34. ^ Newton Love View profile  More options. "I'm happy again! – comp.os.os2.advocacy | Google Groups". Retrieved 23 May 2009. 
  35. ^ Newton Love
  36. ^ Caleb Crain (23 November 2009). "Against Camel Case". New York Times. 
  37. ^ J. Epelboim, J. Booth, R. Ashkenazy, and A. Taleghani R. steinmans (1997). "Fillers and spaces in text: The importance of word recognition during reading". Vision Research, 37(20). 
  38. ^ Dave Binkley and Marcia Davis and Dawn Lawrie and Christopher Morrell (2009). "To CamelCase or Under_score". IEEE 17th International Conference on Program Comprehension, 2009. ICPC '09. (IEEE): 158–167.  
  39. ^ Bonita Sharif and Jonathan I. Maletic (2010). "An Eye Tracking Study on camelCase and under_score Identifier Styles". IEEE 18th International Conference on Program Comprehension, 20010. ICPC '10. (IEEE): 196–205. An empirical study to determine if identifier-naming conventions (i.e., camelCase and under_score) affect code comprehension is presented. An eye tracker is used to capture quantitative data from human subjects during an experiment. The intent of this study is to replicate a previous study published at ICPC 2009 (Binkley et al.) that used a timed response test method to acquire data. The use of eye-tracking equipment gives additional insight and overcomes some limitations of traditional data gathering techniques. Similarities and differences between the two studies are discussed. One main difference is that subjects were trained mainly in the underscore style and were all programmers. While results indicate no difference in accuracy between the two styles, subjects recognize identifiers in the underscore style more quickly. 
  40. ^ Dave Binkley and Marcia Davis and Dawn Lawrie and Christopher Morrell (2009). "To CamelCase or Under_score". IEEE 17th International Conference on Program Comprehension, 2009. ICPC '09. (IEEE): 158–167.  

External links

  • Examples and history of CamelCase, also WordsSmashedTogetherLikeSo
  • .NET Framework General Reference Capitalization Styles
  • What's in a nAME(cq)?, by Bill Walsh, at The Slot
  • The Science of Word Recognition, by Kevin Larson, Advanced Reading Technology, Microsoft Corporation
  • OASIS Cover Pages: CamelCase for Naming XML-Related Components
  • Convert text to CamelCase, Title Case, Uppercase and lowercase
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.