Camel case (sometimes stylized autologically as camelCase or CamelCase, also known as camel caps or more formally as medial capitals) is a writing format practice of writing phrases with capitalized words and yet without spaces or punctuation. The practice has various names and conventions. The earliest known occurrence of a term for this style, InterCaps, was on Usenet in April 1990.
The use of medial capitals as a convention in the regular spelling of everyday texts is rare, but is used in some languages as a solution to particular problems which arise when two words or segments are combined. In the scholarly transliteration of languages written in other scripts, medial capitals are used in similar situations. Medial capitals are sometimes traditionally used in abbreviations to reflect the capitalization that the words would have when written out in full, and they have come into use in unpunctuated abbreviations of academic titles, such as PhD and BSc, which now often replace Ph.D. and B.Sc.
The first systematic and widespread use of medial capitals for technical purposes was the notation for chemical formulas invented by the Swedish chemist Jacob Berzelius in 1813. Since the early 20th century, medial capitals have occasionally been used for corporate names and product trademarks. In the 1970s and 1980s, medial capitals were adopted as a standard or alternative naming convention for multi-word identifiers in several computer programming languages. The use of medial caps for compound identifiers is recommended by the coding style guidelines of many organizations and software projects. Camel case has been criticized as impairing readability, as it creates long compound words strewn with capital letters.
Description The writing format camel case is the practice of writing phrases without spaces or punctuation and with capitalized words. The first word starts with either case, then the following words have an initial uppercase letter. Common examples include YouTube, PowerPoint, HarperCollins, FedEx, iPhone, eBay, and LaGuardia. 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.
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 the upper camel case separately as Pascal case. Some programming styles prefer camel case with the first letter capitalized, others not. For clarity, this article leaves the definition of camel case ambiguous with respect to capitalization of the first word, 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.
Variations and synonyms The practice has various names, including:
camelBack (or camel-back) notationC# Coding Standards and Guidelines at Purdue University College of Technology or CamelCaps CapitalizedWords or CapWords for initial upper camel case in PythonStyle Guide for Python Code at www.python.org compoundNames Embedded caps (or embedded capitals) HumpBack (or hump-back) notationASP Naming Conventions , by Nannette Thacker (05/01/1999) InterCaps or intercapping (abbreviation of Internal Capitalization) medial capitals, recommended by the Oxford English Dictionary mixedCase for initial lower camel case in Python PascalCase for initial upper camel case (after the Pascal programming language) Smalltalk case WikiWord or WikiCase (especially in older wikis)
History
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. The earliest use of the name "Camel Case" occurs in 1995, in a post by Newton Love. Love has since said, "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. ... The citation above was just the first time I had used the name on USENET." The term "Pascal Case" was coined in design discussions for the .NET Framework, first released in 2002.
Traditional use in natural language
In word combinations The use of medial capitals as a convention in the regular spelling of everyday texts is rare, but is used in some languages as a solution to particular problems which arise when two words or segments are combined.
In Italian, pronouns can be suffixed to verbs, and because the honorific form of second-person pronouns is capitalized, this can produce a sentence like non ho trovato il tempo di risponderLe ("I have not found time to answer you" – where Le means "to you").
In German, many nouns denoting people lack a gender-neutral form, which is why often, especially colloquially, the male form of a noun is used generically to address everyone, regardless of their gender (this is called generisches Maskulinum in German). Another, more recent approach is using the medial capital letter I, called Binnen-I, in written text for words like StudentInnen ("students") to indicate that both Studenten ("male students") and Studentinnen ("female students") are referred to simultaneously. However, mid-word capitalization does not conform to the German orthography prescribed by the Rat für deutsche Rechtschreibung (Council for German Orthography) apart from proper names like McDonald. In order to adhere to orthography, the introductory "students" example could be corrected using parentheses to Student(inn)en, which is analogous to writing "congress(wo)men" in English.
In Irish, camel case is used when an inflectional prefix is attached to a proper noun, for example ("in Galway"), from ("Galway"); ("the Scottish person"), from ("Scottish person"); and ("to Ireland"), from ("Ireland"). In recent Scottish Gaelic orthography, a hyphen has been inserted: .
This convention of inflectional prefix is also used by several written Bantu languages (e.g. isiZulu, "Zulu language") and several indigenous languages of Mexico (e.g. Nahuatl, Totonacan, Mixe–Zoque, and some Oto-Manguean languages).
In Chinese pinyin, camel case is sometimes used for place names so that readers can more easily pick out the different parts of the name. For example, places like Beijing (北京), Qinhuangdao (秦皇岛), and Daxing'anling (大兴安岭) can be written as BeiJing, QinHuangDao, and DaXingAnLing respectively, with the number of capital letters equaling the number of Chinese characters. Writing word compounds only by the initial letter of each character is also acceptable in some cases, so Beijing can be written as BJ, Qinghuangdao as QHD, and Daxing'anling as DXAL.
In English, medial capitals are usually only found in Scottish or Irish "Mac-" or "Mc-" patronymic names, where for example MacDonald, McDonald, and Macdonald are common spelling variants of MacDonald (son of Dòmhnall), and in Anglo-Norman "Fitz-" names, where for example both FitzGerald and Fitzgerald (son of Gerald) are found.
In their English style guide The King's English, first published in 1906, H. W. and 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".
Some French names also uses CamelCase names, such as LeBeau (surname), LaRue, DeMordaunt, and Italian names DeRose/DeRosa.
In transliterations
In the scholarly transliteration of languages written in other scripts, medial capitals are used in similar situations. For example, in transliterated Hebrew, haIvri means "the Hebrew person" or "the Jew" and b'Yerushalayim means "in Jerusalem". In Tibetan proper names like rLobsang, the "r" 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 Chechnya and Ingushetia; the letter "I" (palochka) is not actually capital, denoting a phoneme distinct from the one transcribed as "i".
In abbreviations Medial capitals are traditionally used in abbreviations to reflect the capitalization that the words would have when written out in full, for example in the academic titles PhD or BSc. A more recent example is NaNoWriMo, a contraction of National Novel Writing Month and the designation for both the annual event and the nonprofit organization that runs it. In German, the names of statutes are abbreviated using embedded capitals, e.g. StGB for (Criminal Code), PatG for (Patent Act), BVerfG for (Federal Constitutional Court), or the very common GmbH, for (private limited company). In this context, there can even be three or more camel case capitals, e.g. in TzBfG for (Act on Part-Time and Limited Term Occupations). 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 ДШК.
History of modern technical use
Chemical formulas The first systematic and widespread use of medial capitals for technical purposes was the notation for chemical formulas invented by the Swedish chemist Jacob 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 formulas like "NaCl" to be written without spaces and still be parsed without ambiguity.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.Henry M. Leicester & Herbert S. Klickstein, eds. 1952, A Source Book in Chemistry, 1400-1900 (Cambridge, MA: Harvard)
Berzelius' system continues to be used, augmented with three-letter symbols such as "Uue" for unconfirmed or unknown elements and abbreviations for some common substituents (especially in the field of organic chemistry, for instance "Et" for "ethyl-"). This has been further extended to describe the amino acid sequences of proteins and other similar domains.
Early use in trademarks Since the early 20th century, medial capitals have occasionally been used for corporate names and product trademarks, such as DryIce Corporation (1925) marketed the solid form of carbon dioxide (CO2) as "Dry Ice", thus leading to its common name. CinemaScope and VistaVision, rival widescreen movie formats (1953) ShopKo (1962), retail stores, later renamed Shopko MisteRogers Neighborhood, the TV series also called Mister Rogers' Neighborhood (1968) ChemGrass (1965), later renamed AstroTurf (1967) ConAgra (1971), formerly Consolidated Mills MasterCraft (1968), a sports boat manufacturer