Jump to content

Camel case: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
some history - did you know that cliff adams added free links to the software specifically for wikipedia?
mNo edit summary
Line 1: Line 1:
'''Camel case''' is a capitalization convention commonly used in [[computer programming]], and adopted by [[WikiWiki]] software convention for automatically making links.
'''CamelCase''' is a capitalization convention commonly used in [[computer programming]], and adopted by [[WikiWiki]] software convention for automatically making links.


It refers to words which are capitalized at the beginning and within the word, often made by concatenating capitalized words together. For example:
It refers to words which are capitalized at the beginning and within the word, often made by concatenating capitalized words together. For example:
Line 9: Line 9:
Another solution is to use lower-case letters for most of the symbol, with upper-case at the starts of separate words. For instance, if one wanted to name a symbol "the colour of the bar", this would typically be camel cased as "TheColourOfTheBar". In ''lower'' camel case it would be "theColourOfTheBar". [[Coding_standard| Coding standard]]s, which many [[Software_developer|Software developer]]s adhere to, outline preferred uses of CamelCase for [[method]] names, [[field]]s and [[property|properties]].
Another solution is to use lower-case letters for most of the symbol, with upper-case at the starts of separate words. For instance, if one wanted to name a symbol "the colour of the bar", this would typically be camel cased as "TheColourOfTheBar". In ''lower'' camel case it would be "theColourOfTheBar". [[Coding_standard| Coding standard]]s, which many [[Software_developer|Software developer]]s adhere to, outline preferred uses of CamelCase for [[method]] names, [[field]]s and [[property|properties]].


Camel case is also the original [[wiki]] convention for creating [[hyperlink]]s, with the additional requirement that the capitals are followed by a lower-case letter, hence AlabamA and ABc will not be links, see http://c2.com/cgi/wiki?WikiCase.
CamelCase is also the original [[wiki]] convention for creating [[hyperlink]]s, with the additional requirement that the capitals are followed by a lower-case letter, hence AlabamA and ABc will not be links, see http://c2.com/cgi/wiki?WikiCase.


Synonyms:
Synonyms:
Line 24: Line 24:
Link: http://c2.com/cgi/wiki?CamelCase
Link: http://c2.com/cgi/wiki?CamelCase


== Camel Case and Wikipedia ==
== CamelCase and Wikipedia ==
[[Wikipedia]] started using CamelCase at first, but then converted to free links - by putting <nowiki>[[square brackets]]</nowiki> around phrases to be linked. On January 27, 2001, [[Clifford Adams]], author of the original [[UseMod]] software used for Wikipedia, posted the following to the Wikipedia mailing list:
[[Wikipedia]] started using CamelCase at first, but then converted to free links - by putting <nowiki>[[square brackets]]</nowiki> around phrases to be linked. On January 27, 2001, [[Clifford Adams]], author of the original [[UseMod]] software used for Wikipedia, posted the following to the Wikipedia mailing list:



Revision as of 04:39, 5 May 2003

CamelCase is a capitalization convention commonly used in computer programming, and adopted by WikiWiki software convention for automatically making links.

It refers to words which are capitalized at the beginning and within the word, often made by concatenating capitalized words together. For example:

  • CamelCase (sometimes thus to emphasise the meaning)
  • AlabamA (CamelCased words need at least two capital letters)

Most programming languages require various symbols to contain no whitespace (spaces, tabs, etc.), which can make longer symbols harder to read. One solution to this problem is to replace spaces with underscores, but these are difficult to type due to their location on the keyboard.

Another solution is to use lower-case letters for most of the symbol, with upper-case at the starts of separate words. For instance, if one wanted to name a symbol "the colour of the bar", this would typically be camel cased as "TheColourOfTheBar". In lower camel case it would be "theColourOfTheBar". Coding standards, which many Software developers adhere to, outline preferred uses of CamelCase for method names, fields and properties.

CamelCase is also the original wiki convention for creating hyperlinks, with the additional requirement that the capitals are followed by a lower-case letter, hence AlabamA and ABc will not be links, see http://c2.com/cgi/wiki?WikiCase.

Synonyms:

  • InterCaps
  • NerdCaps
  • BiCapitalized
  • BumpyCase
  • HumpBackNotation
  • MixedCase
  • InternalCapitalization
  • StudlyCaps
  • CamelHumpedWord

Link: http://c2.com/cgi/wiki?CamelCase

CamelCase and Wikipedia

Wikipedia started using CamelCase at first, but then converted to free links - by putting [[square brackets]] around phrases to be linked. On January 27, 2001, Clifford Adams, author of the original UseMod software used for Wikipedia, posted the following to the Wikipedia mailing list:


   I've done a lot of thinking about WikiLinking recently, and I'm not sure 
that the WikiName (capital letters) convention is a good fit for the  
encyclopedia.  The AccidentalLinking is a nice feature, but it has a price in 
harder-to-read links and confusing conventions.
   For instance, when I recently wanted to link to "democracy", I first did a
search to see if someone else had linked the name (I thought someone might
have already used "DemoCracy").  I found that nobody else had linked that
name, so I made the link "DemocracY" (to follow the new convention of
last-letter-capitalized).  In short, it took me far more time to make that
link than it would have to just type [[democracy]].  Someone unfamiliar with
the local wiki conventions might guess otherwise on another page and link to a
separate "DemoCracy" or even "DeMocracy".  Ick.
   To make a longish story short, I added code (about 150 new lines of Perl)
to my development copy to allow (site-optional) "Free" linking within [[double
brackets]].  You can use spaces, numbers, commas, dashes, and the period
character in these kinds of links.  Valid link names include [[George W.
Bush]], [[China-Soviet Relations]], [[Physics]], [[music]], and [[Year 2000
bug]].  User names can also use these new links.  Internally and within URLs
the spaces are replaced with _ (underline) characters, which are translated
back to spaces for display purposes.

CamelCase can still be found in the non-encyclopedia parts of Wikipedia, such as Talk pages, where the links have not been updated. Many Wikipedians have CamelCased user names, either as a leftover from the early days, or carried over from other wikis.