Camel case is a standard identifier naming convention for several programming languages, and has become fashionable in marketing for names of products and companies. However, camel case is rarely used in formal written English, and most style guides recommend against its use.
The StudlyCaps style is similar (but not necessarily identical) to camel case. It is sometimes used in reference to camel case but can also refer to random mixed capitalisation (as in "MiXeD CaPitALiZaTioN"), popularly used in 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.
Camel case is also distinct from Tall Man lettering, which uses capitals to emphasize the differences between similar-looking words.
Camel case has always been used (albeit sporadically) in English, for example, as a traditional spelling style for certain surnames, such as in Scottish MacLean (originally, "son of Gillean") and Hiberno-Norman FitzGerald ("son of Gerald"). This same convention is sometimes used in English for surnames of foreign origin which include prepositions or other particles, e.g., DuPont (from French Dupont or du Pont), DiCaprio (from Italian Di Caprio), and VanDyke (from Dutch van Dijk). The actress ZaSu Pitts, whose fame peaked in the 1930s and 1940s, sometimes spelled her given name in CamelCase, emphasizing its derivation from two other names.
From the mid-20th century, it has occasionally been used for corporate names and product trademarks, such as
Camel case has also been used for acronyms like DoD, chemical formulas like NaCl (early 19th century), and other technical codes like HeLa (1983).
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". However, this solution was not adequate for algebraic-oriented languages like FORTRAN (1955) and ALGOL (1958), which needed the hyphen as a subtraction operator. (FORTRAN also restricted identifiers to six characters or fewer at the time, preventing multi-word identifiers except those made of very short words.) Since the common punched card character sets of the time had no lower-case letters and no other special character that would be adequate for the purpose, those early languages had to do without multi-word identifiers.
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. Yet, some languages and programmers chose to avoid underscores and adopted camel case instead. Two accounts are commonly given for the origin of this convention.
Indeed, the underscore key is inconveniently placed in most keyboards. Additionally, in some fonts the underscore character can be confused with a minus sign; it can be overlooked because it falls below the string of characters, or it can be lost entirely when displayed or printed underlined, or when printed on a dot-matrix printer with a defective pin or misaligned ribbon. Moreover, early compilers severely restricted the length of identifiers (e.g., to 8 or 14 letters), or silently truncated all identifiers to that length. Finally, the small size of computer displays available in the 1970s encouraged the use of short identifiers. It was for these reasons, some claim, that many C programmers opted to use camel case instead of underscores, for it yielded legible compound names with fewer keystrokes and fewer characters.
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.
This fashion has become so pervasive that people often apply camel case to names that do not use it officially, e.g. hypercorrecting Usenet to "UseNet", Transamerica to "TransAmerica", Photoshop to "PhotoShop", Firefox to "FireFox", Game Boy to "GameBoy", Macworld to "MacWorld", and Caltech to "CalTech".
During the dot-com bubble of the late 1990s, the lowercase prefixes "e" (for "electronic") and "i" (for "Internet", "information", or perhaps "intelligent") became quite common, giving rise to some camel case names like iPod and eBox.
In 1998, Dave Yost suggested using camel case for long chemical names such as AmidoPhosphoRibosylTransferase . The city of SeaTac, Washington, incorporated in 1990, is an example of a city officially spelled in camel case.
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, with BiCapitalization appearing slightly later in a 1991 post by Eric S. Raymond to the same group. The earliest use of the name "CamelCase" occurs in 1995, in a post by Newton Love. "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 Newton, "The citation above was just the first time I had used the name on USENET.
The name CamelCase is not related to the "Camel Book" (Programming Perl), which uses all-lowercase identifiers with underscores in its sample code.
These recommendations often distinguish between UpperCamelCase and lowerCamelCase, typically specifying which variety should be used for specific kinds of entities: variables, record fields, methods, procedures, types, etc.
One widely used Java coding style dictates that UpperCamelCase be used for classes, and lowerCamelCase be used for instances and methods. Recognising this usage, some IDEs, such as Eclipse, implement shortcuts based on CamelCase. For instance, in Eclipse's Content assist feature, typing just the upper-case letters of a CamelCase word will suggest any matching class or method name (for example, typing "NPE" and activating content assist could suggest "NullPointerException").
The original Hungarian notation for programming specifies that a lowercase abbreviation for the "usage type" (not data type) should prefix all variable names, with the remainder of the name in UpperCamelCase; as such it is a form of lowerCamelCase. CamelCase is the official convention for file names in Java and for the Amiga personal computer.
Microsoft .NET recommends lowerCamelCase for parameters and non-public fields and UpperCamelCase (aka "Pascal Style") for other types of identifiers.
Python recommends UpperCamelCase for class names.
The NIEM registry requires that XML Data Elements use UpperCamelCase and XML Attributes use lowerCamelCase.
Camel case is by no means universal in computing. Users of several modern programming languages, notably those in the Lisp and Forth families, nearly always use hyphens. Among the reasons sometimes given are that doing so does not require shifting on most keyboards, that the words are more readable when they are separated, and that camel case may simply not be reliably preserved in case-insensitive or case-folding languages (such as Common Lisp, that, while technically a case-sensitive language, canonicalizes (folds) identifiers to uppercase by default).
CamelCase has been used in languages other than English for a variety of purposes, including the ones below:
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).
Several Bantu languages also use this convention, e.g., kiSwahili ("Swahili language" in Swahili) and isiZulu ("Zulu language" in Zulu).
Camel case is often used to transliterate acronyms from alphabets where two letters may be required to represent a single character of the original alphabet, e.g., DShK from Cyrillic ДШК.