
The writing format 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'', ''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
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
, use the term ''camel case'' only for lower camel case, designating Pascal case for the upper camel 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, 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
Prednisone is a glucocorticoid medication mostly used to immunosuppressive drug, suppress the immune system and decrease inflammation in conditions such as asthma, COPD, and rheumatologic diseases. It is also used to treat high blood calcium ...
'' and ''
predniSOLONE
Prednisolone is a corticosteroid, a steroid hormone used to treat certain types of allergies, inflammation, inflammatory conditions, autoimmune disorders, and cancers, Electrolyte imbalance, electrolyte imbalances and skin conditions. Some of ...
''; and ''
snake case'', which uses
underscore
An underscore or underline is a line drawn under a segment of text. In proofreading, underscoring is a convention that says "set this text in italic type", traditionally used on manuscript or typescript as an instruction to the printer. Its ...
s 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) notation or CamelCaps
* camel case or CamelCase
* CapitalizedWords or CapWords for upper camel case in
Python[Style Guide for Python Code](_blank)
a
www.python.org
/ref>
* compoundNames
* Embedded caps (or embedded capitals)
* HumpBack (or hump-back) notation
* InterCaps or intercapping (abbreviation of ''Internal Capitalization'')
* medial capitals, recommended by the Oxford English Dictionary
The ''Oxford English Dictionary'' (''OED'') is the principal historical dictionary of the English language, published by Oxford University Press (OUP), a University of Oxford publishing house. The dictionary, which published its first editio ...
* mixedCase for lower camel case in Python
* PascalCase for upper camel case (after the Pascal programming language)
* Smalltalk
Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learni ...
case
* WikiWord[TWiki">] or WikiCase[WikiWikiWeb">] (especially in older wiki
A wiki ( ) is a form of hypertext publication on the internet which is collaboratively edited and managed by its audience directly through a web browser. A typical wiki contains multiple pages that can either be edited by the public or l ...
s)
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
Galway ( ; , ) is a City status in Ireland, city in (and the county town of) County Galway. It lies on the River Corrib between Lough Corrib and Galway Bay. It is the most populous settlement in the province of Connacht, the List of settleme ...
"), 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
The Bantu languages (English: , Proto-Bantu language, Proto-Bantu: *bantʊ̀), or Ntu languages are a language family of about 600 languages of Central Africa, Central, Southern Africa, Southern, East Africa, Eastern and Southeast Africa, South ...
(e.g. ''isiZulu'', " Zulu language") and several indigenous languages of Mexico (e.g. Nahuatl
Nahuatl ( ; ), Aztec, or Mexicano is a language or, by some definitions, a group of languages of the Uto-Aztecan language family. Varieties of Nahuatl are spoken by about Nahuas, most of whom live mainly in Central Mexico and have smaller popul ...
, Totonacan, Mixe–Zoque, and some Oto-Manguean languages).
In Dutch, when capitalizing the digraph '' ij'', both the letter ''I'' and the letter ''J'' are capitalized, for example in the country name '' IJsland'' ("Iceland").
In Chinese pinyin
Hanyu Pinyin, or simply pinyin, officially the Chinese Phonetic Alphabet, is the most common romanization system for Standard Chinese. ''Hanyu'' () literally means 'Han Chinese, Han language'—that is, the Chinese language—while ''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
Chinese characters are logographs used Written Chinese, to write the Chinese languages and others from regions historically influenced by Chinese culture. Of the four independently invented writing systems accepted by scholars, they represe ...
. 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 word
In linguistics, a compound is a lexeme (less precisely, a word or Sign language, sign) that consists of more than one Word stem, stem. Compounding, composition or nominal composition is the process of word formation that creates compound lexemes. C ...
s where hyphen
The hyphen is a punctuation mark used to join words and to separate syllables of a single word. The use of hyphens is called hyphenation.
The hyphen is sometimes confused with dashes (en dash , em dash and others), which are wider, or with t ...
s 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
Hebrew (; ''ʿÎbrit'') is a Northwest Semitic languages, Northwest Semitic language within the Afroasiatic languages, Afroasiatic language family. A regional dialect of the Canaanite languages, it was natively spoken by the Israelites and ...
, ''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
The palochka () is a letter in the Cyrillic script. The letter is usually caseless. It was introduced in the late 1930s as the Hindu-Arabic digit ' 1', and on Cyrillic keyboards, it is usually typeset as the Roman numeral ''. Unicode currentl ...
) is not actually capital, denoting a phoneme
A phoneme () is any set of similar Phone (phonetics), speech sounds that are perceptually regarded by the speakers of a language as a single basic sound—a smallest possible Phonetics, phonetic unit—that helps distinguish one word fr ...
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
A private limited company is any type of business entity in Privately held company, "private" ownership used in many jurisdictions, in contrast to a Public company, publicly listed company, with some differences from country to country. Example ...
). 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
The Cyrillic script ( ) is a writing system used for various languages across Eurasia. It is the designated national script in various Slavic, Turkic, Mongolic, Uralic, Caucasian and Iranic-speaking countries in Southeastern Europe, Ea ...
ДШК.
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.
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
Amino acids are organic compounds that contain both amino and carboxylic acid functional groups. Although over 500 amino acids exist in nature, by far the most important are the 22 α-amino acids incorporated into proteins. Only these 22 a ...
sequences of protein
Proteins are large biomolecules and macromolecules that comprise one or more long chains of amino acid residue (biochemistry), residues. Proteins perform a vast array of functions within organisms, including Enzyme catalysis, catalysing metab ...
s and other similar domains.
Early use in trademarks
Since the early 20th century, medial capitals have occasionally been used for corporate
A corporation or body corporate is an individual or a group of people, such as an association or company, that has been authorized by the state to act as a single entity (a legal entity recognized by private and public law as "born out of s ...
names and product trademarks, such as
* DryIce Corporation (1925) marketed the solid form of carbon dioxide
Carbon dioxide is a chemical compound with the chemical formula . It is made up of molecules that each have one carbon atom covalent bond, covalently double bonded to two oxygen atoms. It is found in a gas state at room temperature and at norma ...
(CO2) as "Dry Ice", thus leading to its common name.
* CinemaScope and VistaVision, rival widescreen
Widescreen images are displayed within a set of aspect ratio (image), aspect ratios (relationship of image width to height) used in film, television and computer screens. In film, a widescreen film is any film image with a width-to-height aspect ...
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
* AeroVironment (1971)
* PolyGram (1972), formerly Grammophon-Philips Group
* United HealthCare (1977)
* MasterCard (1979), formerly Master Charge
* SportsCenter (1979)
Computer programming
In the 1970s and 1980s, medial capitals were adopted as a standard or alternative naming convention for multi-word identifier
An identifier is a name that identifies (that is, labels the identity of) either a unique object or a unique ''class'' of objects, where the "object" or class may be an idea, person, physical countable object (or class thereof), or physical mass ...
s in several programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s. The precise origin of the convention in computer programming has not yet been settled. A 1954 conference proceedings occasionally informally referred to IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
's Speedcoding system as "SpeedCo". Christopher Strachey's paper on GPM (1965), shows a program that includes some medial capital identifiers, including "NextCh
" and "WriteSymbol
" (This was most likely the influence of the CPL language, of which Strachey was one of the designers)
Multiple-word descriptive identifiers with embedded spaces such as end of file
or char table
cannot be used in most programming languages because the spaces between the words would be parsed as delimiter
A delimiter is a sequence of one or more Character (computing), characters for specifying the boundary between separate, independent regions in plain text, Expression (mathematics), mathematical expressions or other Data stream, data streams. An ...
s between tokens. The alternative of running the words together as in endoffile
or chartable
is difficult to understand and possibly misleading; for example, chartable
is an English word (able to be charted), whereas charTable
means a table of chars
.
Some early programming languages, notably Lisp
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation.
Originally specified in the late 1950s, ...
(1958) and COBOL (1959), addressed this problem by allowing a hyphen
The hyphen is a punctuation mark used to join words and to separate syllables of a single word. The use of hyphens is called hyphenation.
The hyphen is sometimes confused with dashes (en dash , em dash and others), which are wider, or with t ...
("-") 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) and COBOL because its operators were individual English words. This convention remains in use in these languages, and is also common in program names entered on a command line, as in Unix.
However, this solution was not adequate for mathematically oriented languages such as FORTRAN (1955) and ALGOL
ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
(1958), which used the hyphen as an infix subtraction operator. FORTRAN ignored blanks altogether, so programmers could use embedded spaces in variable names. However, this feature was not very useful since the early versions of the language restricted identifiers to no more than six characters.
Exacerbating the problem, common punched card
A punched card (also punch card or punched-card) is a stiff paper-based medium used to store digital information via the presence or absence of holes in predefined positions. Developed over the 18th to 20th centuries, punched cards were widel ...
character sets of the time were uppercase only and lacked other special characters. It was only in the late 1960s that the widespread adoption of the ASCII
ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
character set made both lowercase and the underscore
An underscore or underline is a line drawn under a segment of text. In proofreading, underscoring is a convention that says "set this text in italic type", traditionally used on manuscript or typescript as an instruction to the printer. Its ...
character _
universally available. Some languages, notably C, promptly adopted underscores as word separators, and identifiers such as end_of_file
are still prevalent in C programs and libraries (as well as in later languages influenced by C, such as Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".
Perl was developed ...
and Python). However, some languages and programmers chose to avoid underscores and adopted camel case instead.
Charles Simonyi, who worked at Xerox PARC in the 1970s and later oversaw the creation of Microsoft's Office suite of applications, invented and taught the use of Hungarian Notation
Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kin ...
, one version of which uses the lowercase letter(s) at the start of a (capitalized) variable name to denote its type. One 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 (whose place was taken by a left arrow "←"), 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 lower camel case that was strictly followed by the Mesa libraries and the Alto operating system. Niklaus Wirth
Niklaus Emil Wirth ( IPA: ) (15 February 1934 – 1 January 2024) was a Swiss computer scientist. He designed several programming languages, including Pascal, and pioneered several classic topics in software engineering. In 1984, he won the Tu ...
, the inventor of Pascal, came to appreciate camel case during a sabbatical at PARC and used it in Modula
The Modula programming language is a descendant of the Pascal language. It was developed in Switzerland, at ETH Zurich, in the mid-1970s by Niklaus Wirth, the same person who designed Pascal. The main innovation of Modula over Pascal is a mo ...
, his next programming language.
The Smalltalk
Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learni ...
language, which was developed originally on the Alto, also uses camel case instead of underscores. This language became quite popular in the early 1980s, and thus may also have been instrumental in spreading the style outside PARC.
Upper camel case (or "Pascal case") is used in Wolfram Language in computer algebraic system Mathematica for predefined identifiers. User defined identifiers should start with a lower case letter. This avoids the conflict between predefined and user defined identifiers both today and in all future versions.
C# variable names are recommended to follow the lower camel case convention.
Computer companies and products
Whatever its origins in the computing field, the convention was used in the names of computer companies and their commercial brands, since the late 1970s — a trend that continues to this day:
* (1977) CompuServe
CompuServe, Inc. (CompuServe Information Service, Inc., also known by its initialism CIS or later CSi) was an American Internet company that provided the first major commercial online service provider, online service. It opened in 1969 as a times ...
* (1978) WordStar
* (1979) VisiCalc
* (1982) MicroProse
MicroProse is an American video game publisher and video game developer, developer founded by Bill Stealey, Sid Meier, and Andy Hollis in 1982. It developed and published numerous games, including starting the ''Civilization (series), Civilizat ...
, WordPerfect
* (1983) NetWare
* (1984) LaserJet, MacWorks, PostScript
PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
* (1985) PageMaker
* (1987) ClarisWorks, HyperCard
HyperCard is a application software, software application and software development kit, development kit for Apple Macintosh and Apple IIGS computers. It is among the first successful hypermedia systems predating the World Wide Web.
HyperCard com ...
, PowerPoint
* (1990) WorldWideWeb (the first web browser), later renamed Nexus
Spread to mainstream usage
In the 1980s and 1990s, after the advent of the personal computer exposed hacker culture to the world, camel case then became fashionable for corporate trade name
A trade name, trading name, or business name is a pseudonym used by companies that do not operate under their registered company name. The term for this type of alternative name is fictitious business name. Registering the fictitious name with ...
s in non-computer fields as well. Mainstream usage was well established by 1990:
* (1980) EchoStar
* (1984) BellSouth
* (1985) ''EastEnders
''EastEnders'' is a British television soap opera created by Julia Smith (producer), Julia Smith and Tony Holland which has been broadcast on BBC One since February 1985. Set in the fictional borough of Walford in the East End of London, the ...
''
* (1986) '' SpaceCamp''
* (1990) HarperCollins
HarperCollins Publishers LLC is a British–American publishing company that is considered to be one of the "Big Five (publishers), Big Five" English-language publishers, along with Penguin Random House, Hachette Book Group USA, Hachette, Macmi ...
, SeaTac
* (1998) PricewaterhouseCoopers, merger of Price Waterhouse and Coopers
During the dot-com bubble
The dot-com bubble (or dot-com boom) was a stock market bubble that ballooned during the late-1990s and peaked on Friday, March 10, 2000. This period of market growth coincided with the widespread adoption of the World Wide Web and the Interne ...
of the late 1990s, the lowercase prefixes "e" (for " electronic") and "i" (for "Internet", "information", " intelligent", etc.) became quite common, giving rise to names like Apple
An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
'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. This usage was not widely adopted.
Camel case is sometimes used for abbreviated names of certain neighborhoods, e.g. New York City neighborhoods ''SoHo'' (''So''uth of ''Ho''uston Street) and ''TriBeCa'' (''Tri''angle ''Be''low ''Ca''nal Street) and San Francisco's ''SoMa'' (''So''uth of ''Ma''rket). 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).
Current usage in computing
Programming and coding
The use of medial caps for compound identifiers is recommended by the coding style guidelines of many organizations or software projects. For some languages (such as Mesa, Pascal, Modula
The Modula programming language is a descendant of the Pascal language. It was developed in Switzerland, at ETH Zurich, in the mid-1970s by Niklaus Wirth, the same person who designed Pascal. The main innovation of Modula over Pascal is a mo ...
, Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
and Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
's .NET
The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
) 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, functions, subroutines, types
Type may refer to:
Science and technology Computing
* Typing, producing text via a keyboard, typewriter, etc.
* Data type, collection of values used for computations.
* File type
* TYPE (DOS command), a command to display contents of a file.
* Ty ...
, etc. These rules are sometimes supported by static analysis tools that check source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
for adherence.
The original Hungarian notation
Hungarian notation is an identifier naming convention in computer programming in which the name of a variable or function indicates its intention or kind, or in some dialects, its type. The original Hungarian notation uses only intention or kin ...
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 uppercase, such as "old HTML file". By analogy with the title case rules, the natural camel case rendering would have the abbreviation all in uppercase, 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 words and write "oldHtmlFile", "parseDbmXml" or "sqlServer". However, this can make it harder to recognize that a given word is intended as an acronym.
Difficulties arise when identifiers have different meaning depending only on the case, as can occur with mathematical functions or trademarks. In this situation changing the case of an identifier might not be an option and an alternative name need be chosen.
Wiki link markup
Camel case is used in some wiki markup languages for terms that should be automatically linked to other wiki
A wiki ( ) is a form of hypertext publication on the internet which is collaboratively edited and managed by its audience directly through a web browser. A typical wiki contains multiple pages that can either be edited by the public or l ...
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. Wikipedia 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. MediaWiki
MediaWiki is free and open-source wiki software originally developed by Magnus Manske for use on Wikipedia on January 25, 2002, and further improved by Lee Daniel Crocker,mailarchive:wikipedia-l/2001-August/000382.html, Magnus Manske's announc ...
, for example, does not support camel case for linking. 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
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
data elements use upper camel case and XML attributes use lower camel case.
Most popular command-line interface
A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
s 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.
Social media accessibility
Microblogging
Microblogging is a form of blogging using short posts without titles known as microposts or status updates. Microblogs "allow users to exchange small elements of content such as short sentences, individual images, or video links", which may be the ...
and social networking service
A social networking service (SNS), or social networking site, is a type of online social media platform which people use to build social networks or social relationships with other people who share similar personal or career content, interest ...
s that limit the number of characters in a message are potential outlets for medial capitals. Using camel case 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. Hashtags, especially long ones, often use camel case to maintain readability (e.g. #CollegeStudentProblems is easier to read than #collegestudentproblems); this practice improves accessibility as screen reader
A screen reader is a form of assistive technology (AT) that renders text and image content as speech or braille output. Screen readers are essential to blindness, blind people, and are useful to visually impaired people, Illiteracy, illiterate, ...
s recognize CamelCase in parsing composite hashtags.
In website URLs, spaces are percent-encoded as "%20", making the address longer and less human readable. By omitting spaces, camel case does not have this problem.
Readability studies
Camel case has been criticized as negatively impacting readability due to the removal of spaces and uppercasing of every word.
A 2009 study of 135 subjects comparing snake case (underscored identifiers) to camel case found that camel case identifiers were recognized with higher accuracy among all subjects. Subjects recognized snake case identifiers more quickly than camel case identifiers. Training in camel case sped up camel case recognition and slowed snake case recognition, although this effect involved coefficients with high p-values. The study also conducted a subjective survey and found that non-programmers either preferred underscores or had no preference, and 38% of programmers trained in camel case stated a preference for underscores. However, these preferences had no statistical correlation to accuracy or speed when controlling for other variables.
A 2010 follow-up study used a similar study design with 15 subjects consisting of expert programmers trained primarily in snake case. It used a static rather than animated stimulus and found perfect accuracy in both styles except for one incorrect camel case response. Subjects recognized identifiers in snake case more quickly than camel case. The study used eye-tracking equipment and found that the difference in speed for its subjects was primarily due to the fact that average duration of fixations for camel-case was significantly higher than that of snake case for 3-part identifiers. The survey recorded a mixture of preferred identifier styles but again there was no correlation of preferred style to accuracy or speed.
See also
References
External links
Camel Case Guide & Converter
further reading on usage with examples
Examples and history of CamelCase
als
WordsSmashedTogetherLikeSo
.NET Framework General Reference Capitalization Styles
by Bill Walsh, at The Slot
The Science of Word Recognition
by Kevin Larson, Advanced Reading Technology, Microsoft Corporation
Convert text to CamelCase
* ttps://titlecapitalize.com/text-to-camelcase/ Convert text to CamelCase, Title Case, Uppercase and lowercase
Demystifying Common Casings in Programming: What They Are and When to Use Them
{{Typography terms
Capitalization
Naming conventions
Typography
Source code
Metaphors referring to camels