Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Camel case
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Current usage in computing == === Programming and coding === {{main article|Naming convention (programming)}} 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 (programming language)|Mesa]], [[Pascal (programming language)|Pascal]], [[Modula]], [[Java (programming language)|Java]] and [[Microsoft]]'s [[.NET]]) 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: [[variable (computer science)|variable]]s, [[field (computer science)|record fields]], [[method (computer science)|method]]s, [[procedure (computer science)|procedures]], [[Function (computer science)|functions]], [[subroutine]]s, [[type (computer science)|types]], etc. These rules are sometimes supported by [[static code analysis|static analysis]] tools that check [[source code]] for adherence. The original [[Hungarian notation]] 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".<ref>{{cite web |title=Google Java Style Guide |url=https://google.github.io/styleguide/javaguide.html#s5.3-camel-case |website=google.github.io |access-date=2 November 2022}}</ref> However, this can make it harder to recognize that a given word is intended as an acronym.<ref>{{cite journal|title=To CamelCase or Under_score|author1=Dave Binkley|author2=Marcia Davis|author3=Dawn Lawrie|author4=Christopher Morrell|citeseerx=10.1.1.158.9499|publisher=IEEE|pages=158β167|journal=IEEE 17th International Conference on Program Comprehension, 2009. ICPC '09.|year=2009|quote=In terms of camel-cased identifiers, this has a greater impact on identifiers that include short words and especially acronyms. For example, consider the acronym ID found in the identifier kIOuterIIDPath. Because of the run of uppercase letters, the task of reading kIOuterIIDPath, in particular the identification of the word ID, is more difficult.}}</ref> 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 [[wikitext|wiki markup languages]] for terms that should be automatically linked to other [[wiki]] pages. This convention was originally used in [[Ward Cunningham]]'s original [[wiki software]], [[WikiWikiWeb]],<ref>Andrew Lih, ''The Wikipedia Revolution: How a Bunch of Nobodies Created the World's Greatest Encyclopedia'' (New York: Hyperion, 2009), pp. 57β58.</ref> 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 [[Plug-in (computing)|plugin]] to disable it. Wikipedia formerly used camel case linking as well, but switched to explicit link markup using [[square brackets]]<ref>Lih, ''The Wikipedia Revolution'', pp. 62β63, 67.</ref> and many other wiki sites have done the same. [[MediaWiki]], for example, [[mw:Manual:MediaWiki feature list#Structures and syntax|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 [[National Information Exchange Model|NIEM]] registry requires that [[XML]] data elements use upper camel case and XML attributes use lower camel case. Most popular [[command-line interface]]s and [[shell script|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 <span style="font-family: monospace, monospace;">MyJobResume.pdf</span>. ==== Social media accessibility ==== [[Microblogging]] and [[social networking service]]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. [[Hashtag]]s, especially long ones, often use camel case to maintain readability (e.g. #CollegeStudentProblems is easier to read than #collegestudentproblems);<ref>{{cite web |last1=Blackwood |first1=Jessica |last2=Brown |first2=Kate |title=Accessible Use of CamelCase and Structuring Posts |url=https://ecampusontario.pressbooks.pub/accessibledigitalcontenttraining/chapter/accessible-use-of-camelcase-and-structuring-posts/ |website=Accessible Digital Content Training |publisher=McMaster University}}</ref> this practice improves [[accessibility]] as [[screen reader]]s recognize CamelCase in parsing composite hashtags.<ref>{{cite web |year=2022 |title=Social Media Accessibility Guidelines |url=https://accessibility.princeton.edu/guidelines/social-media#camelcase |url-status=dead |archive-url=https://web.archive.org/web/20221012082805/https://accessibility.princeton.edu/guidelines/social-media#camelcase |archive-date=12 October 2022 |access-date=12 October 2022 |publisher=Princeton University}}</ref> In website URLs, spaces are [[Percent-encoding|percent-encoded]] as "%20", making the address longer and less [[human readable]]. By omitting spaces, camel case does not have this problem.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)