Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

CamelCase

From Simple English Wikipedia, the free encyclopedia
Camel case is named after the "hump" of its protruding capital letter, similar to the hump of commoncamels.

CamelCase (camel case,camel caps ormedial capitals) is the practice of writingcompound words orphrases so that each next word orabbreviation begins with acapital letter. CamelCase can either start with alowercase or uppercase letter, although the lowercase version is much more common inprogramming. Common examples arePowerPoint oriPhone.

Variations

[change |change source]

There are many variations of CamelCase. A few important ones are:

  • BumpyCaps[1]
  • camelBack (or camel-back) notation[2]
  • CamelCaps[3]
  • CapitalizedWords orCapWords for upper CamelCase inPython[4]      
  • compoundNames[5]
  • Embedded Caps (or Embedded Capitals)[6]
  • HumpBack (or hump-back) notation[7]

  • InterCaps orintercapping[8] (abbreviation ofInternal Capitalization[9])
  • mixedCase for lower CamelCase in Python[4]
  • nerdCaps[1] orheadlessCamelCase
  • Pascal case for upper CamelCase[10][11][12]
  • WikiWord[13] orWikiCase[14] (especially in olderwikis)
  • wimpyCaps[15]

History

[change |change source]

Chemical formulae

[change |change source]

The first use of medial capitals was the notation forchemical formulae invented by theSwedish chemistBerzelius in 1813. He did this to replace the many naming and symbol systems used bychemists at that time. He suggested to show 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 read without confusion. This system is still in use today.[16][17]

Early use in trademarks

[change |change source]

Since the early 20th century,medial capitals have occasionally been used forcorporate names and producttrademarks, such as

Spread to mainstream usage

[change |change source]

Despite its unclear origins inside the computing world, the practice spread in the 1980s and 1990s, when thepersonal computer became popular and exposedhacker culture to the world. CamelCase then became popular for business names. By 1990, it was very common to see CamelCase used in this way:

During the late 1990s when the internet became far more popular and easily available, the lowercaseprefixes "e" (for "electronic") and "i" (for "Internet",[21] "information", "interactive", "intelligent", etc.) became quite common, and we began to see names likeApple'siMac and theeBoxcomputer program.

History of the name "CamelCase"

[change |change source]

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

The earliest known occurrence of the term "InterCaps" onUsenet is in an April 1990 post to the groupalt.folklore.computers by Avi Rappoport,[5] with "BiCapitalization" appearing slightly later in a 1991 post byEric S. Raymond to the same group.[22] The earliest use of the name "CamelCase" occurs in 1995, in a post byNewton Love.[23] "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."[24]

Current usage in computing

[change |change source]

Programming and coding

[change |change source]

The use of medial caps foridentifiers is recommended by many organizations and software projects. For some languages (such asMesa,Pascal,Modula,Java andMicrosoft's.NET) CamelCase is recommended by the language developers or by importantmanuals and has therefore become part of the language's "culture".

Style guidelines often distinguish between upper and lower CamelCase. They usually specify which one should be used for certain kinds of things:variables,record fields,methods,procedures,types, etc. This is sometimes supported bystatic analysis tools that checksource code to make sure it is following these guidelines.

Wiki link markup

[change |change source]

CamelCase is used in somewiki markup languages for terms that should be automatically linked to otherwiki pages. This convention was originally used inWard Cunningham's originalwiki software,WikiWikiWeb, and can be activated in most other wikis. Some wiki engines such asTiddlyWiki,Trac andPMWiki use it in the default settings. They also usually provide an option orplugin to disable it.Wikipedia used to use CamelCase linking. However, they have switched to explicit link markup usingsquare brackets and many other wiki sites have done the same. Some wikis that do not use CamelCase linking may still use the CamelCase as a naming convention, such asAboutUs.

Other uses

[change |change source]

TheNIEM registry requires thatXML data elements use upper CamelCase and XML attributes use lower CamelCase.

Most popularcommand-line interfaces andscripting languages usually can't handle file names that contain embedded spaces. Because of this, users of those systems often use CamelCase (or underscores, hyphens and other "safe" characters) for compound file names likeMyJobResume.pdf.

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

Current usage in natural languages

[change |change source]

CamelCase has been used in languages other than English for several purposes. Some examples are:

Orthographic markings

[change |change source]

CamelCase is sometimes used in the writing or translation of certain scripts as a way to tell the difference between certain letters or markings. An example is the rendering ofTibetan proper names likerLobsang: the "r" here stands for aprefixglyph in the original script that functions astone marker rather than a normal letter. Another example istsIurku, a Latin transcription of theChechen term for the capping stone of the characteristicMedieval defensive towers ofChechenia andIngushetia; the capital letter "I" here showing aphoneme different from the one transcribed as "i".

Inflection prefixes

[change |change source]

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

This convention is used inIrish orthography e.g.,i nGaillimh ("inGalway"), fromGaillimh ("Galway");go hÉireann ("toIreland"), fromÉire ("Ireland).

Similarly, when translating theHebrew language,haIvri means "the Hebrew person" andbiYerushalayim means "in Jerusalem".

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

In abbreviations and acronyms

[change |change source]

Abbreviations of some academic qualifications are sometimes presented in CamelCase without punctuation, e.g.PhD orBSc.

In French, CamelCase acronyms such asOuLiPo (1960) were favored for a time as alternatives toinitialisms (or representingcompound words only by the first letter of each word).

CamelCase is often used to transliterateinitialisms into alphabets where two letters may be required to represent a single character of the original alphabet, e.g.,DShK fromCyrillic ДШК and PPSh from Cyrillic ППШ.

InChinese pinyin, CamelCase is sometimes used for place names so that it is easier for readers to pick out the different parts of the word. For example, places likeBeijing (北京) andQinhuangdao (秦皇岛) andDaxing'anling (大兴安岭) can be written asBeiJing,QinHuangDao, andDaXingAnLing, with the number of capital letters being the same as the number ofChinese characters for each word. Writing word compounds only by the initial letter of each character is also acceptable in some cases, so Beijing can be written asBJ, Qinghuangdao asQHD, and Daxing'anling asDXAL.

Honorifics within compound words

[change |change source]

In several languages, including English,pronouns andpossessives may be capitalized to show respect. For example: when referring to the reader of a formal letter or toGod. In some of those languages, the capitalization is retained even when those words occur within compound words orsuffixed to a verb. For example, in Italian one would writeporgendoLe distinti saluti ("offering to You respectful salutations") oradorarLo ("adore Him").

Other uses

[change |change source]

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

In German, the names ofstatutes are shortened using embedded capitals. An example would be: StGB (Strafgesetzbuch) for criminal code, PatG (Patentgesetz) for Patent Act or the very common GmbH (Gesellschaft mit beschränkter Haftung) forCompany with Limited Liability.

Related pages

[change |change source]

References

[change |change source]
  1. 1.01.1Hayes, Brian (July–August 2006)."The Semicolon Wars".American Scientist Online: The Magazine of Sigma XI. The Scientific Research Society. art. pg. 2.
  2. C# Coding Standards and GuidelinesArchived 2008-04-11 at theWayback Machine atPurdue University College of TechnologyArchived 2013-07-12 at theWayback Machine
  3. "CamelCase". Everything2.com. Retrieved4 June 2010.
  4. 4.04.1Style Guide for Python Code atwww.python.org
  5. 5.05.1"compoundName". 29 March 1990.
  6. "[#APF-1088] If class name has embedded capitals, AppGen code fails UI tests and generated hyperlinks are incorrect. – AppFuse JIRA". Issues.appfuse.org. Archived fromthe original on 25 June 2017. Retrieved4 June 2010.
  7. ASP Naming ConventionsArchived 2009-04-08 at theWayback Machine, by Nannette Thacker (05/01/1999)
  8. Iverson, Cheryl, ed. (2007).AMA Manual of Style (10th ed.). Oxford, Oxfordshire: Oxford University Press.ISBN 978-0-19-517633-9.
  9. Christine A. Hult and Thomas N. Huckin."The Brief New Century Handbook – Rules for internal capitalization". Pearson Education. Archived fromthe original on 7 April 2012. Retrieved3 December 2014.
  10. "Brad Abrams : History around Pascal Casing and Camel Casing". Blogs.msdn.com. 3 February 2004. Retrieved4 January 2014.
  11. "Pascal Case". C2.com. 27 September 2012. Retrieved4 January 2014.
  12. "NET Framework General Reference Capitalization Styles". Msdn2.microsoft.com. Retrieved4 January 2014.
  13. "WikiWord < TWiki < TWiki". Twiki.org. Archived fromthe original on 19 June 2010. Retrieved4 June 2010.
  14. "Wiki Case". C2.com. 8 February 2010. Retrieved4 June 2010.
  15. "String Utilities". 13 July 2007.
  16. 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.
  17. Henry M. Leicester & Herbert S. Klickstein, eds. 1952,A Source Book in Chemistry, 1400-1900 (Cambridge, MA: Harvard)
  18. The Trade-mark Reporter.United States Trademark Association. 1930.ISBN 1-59888-091-8.
  19. ""MisteRogers" (1962)". Imdb.com. Retrieved4 January 2014.
  20. "Unitedhealthgroup.com". Unitedhealthgroup.com. Retrieved4 January 2014.
  21. Farhad Manjoo (30 April 2002)."Grads Want to Study on EMacs, Too". Wired.com. Retrieved4 June 2010.
  22. "The jargon file version 2.5.1 29 January 1991 follows in 15 parts – misc.misc | Google Groups". Groups.google.com. Retrieved23 May 2009.
  23. Newton Love View profile  More options."I'm happy again! – comp.os.os2.advocacy | Google Groups". Groups.google.com. Retrieved23 May 2009.
  24. Newton Love

Other websites

[change |change source]
Wikimedia Commons has media related toCamel case.

Retrieved from "https://simple.wikipedia.org/w/index.php?title=CamelCase&oldid=9514326"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp