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
Letter 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!
===Use within programming languages=== {{See also|Naming convention (programming)#Multiple-word identifiers}} Some case styles are not used in standard English, but are common in [[computer programming]], product [[brand]]ing, or other specialised fields. The usage derives from how programming languages are [[parsing|parsed]], programmatically. They generally separate their syntactic tokens by simple [[Whitespace character|whitespace]], including [[space character]]s, [[tab key|tabs]], and [[newline]]s. When the tokens, such as function and variable names start to multiply in complex [[software development]], and there is still a need to keep the [[source code]] human-readable, [[Naming convention (programming)|Naming conventions]] make this possible. So for example, a function dealing with matrix multiplication might formally be called: * {{code|SGEMM(*)}}, with the asterisk standing in for an equally inscrutable list of 13 parameters (in [[Basic Linear Algebra Subprograms|BLAS]]), * {{code|MultiplyMatrixByMatrix(Matrix x, Matrix y)}}, in some hypothetical higher level [[manifest typing|manifestly typed]] language, broadly following the syntax of [[C++]] or [[Java (programming language)|Java]], * {{code|multiply-matrix-by-matrix(x, y)}} in something derived from [[LISP]], or perhaps * {{code|(multiply (x y))}} in the [[Common Lisp Object System|CLOS]], or some newer derivative language supporting [[type inference]] and [[multiple dispatch]]. In each case, the capitalisation or lack thereof supports a different function. In the first, [[FORTRAN]] compatibility requires case-insensitive naming and short function names. The second supports easily discernible function and argument names and types, within the context of an imperative, strongly typed language. The third supports the macro facilities of LISP, and its tendency to view programs and data minimalistically, and as interchangeable. The fourth idiom needs much less [[syntactic sugar]] overall, because much of the semantics are implied, but because of its brevity and so lack of the need for capitalization or multipart words at all, might also make the code too abstract and [[homonymy|overloaded]] for the common programmer to understand. Understandably then, such coding conventions are [[programming style|highly subjective]], and can lead to rather opinionated debate, such as in the case of [[editor war]]s, or those about [[indent style]]. Capitalisation is no exception. ====Camel case==== {{main|Camel case}} {{blockquote|"theQuickBrownFoxJumpsOverTheLazyDog" or "TheQuickBrownFoxJumpsOverTheLazyDog"}} Spaces and [[punctuation]] are removed and the first letter of each word is capitalised. If this includes the first letter of the first word (CamelCase, "[[PowerPoint]]", "TheQuick...", etc.), the case is sometimes called '''upper camel case''' (or, illustratively, '''CamelCase'''), '''Pascal case''' in reference to the [[Pascal (programming language)|Pascal programming language]]<ref>{{cite web|url=https://docs.microsoft.com/en-us/archive/blogs/brada/history-around-pascal-casing-and-camel-casing|title=History around Pascal Casing and Camel Casing|date=3 February 2004 }}</ref> or '''bumpy case'''. When the first letter of the first word is lowercase ("[[iPod]]", "[[eBay]]", "theQuickBrownFox..."), the case is usually known as '''lower camel case''' or '''dromedary case''' (illustratively: '''dromedaryCase'''). This format has become popular in the branding of [[information technology]] products and services, with an initial "i" meaning "[[Internet]]" or "intelligent",{{Citation needed|date=August 2022}} as in [[iPod]], or an initial "e" meaning "electronic", as in [[email]] (electronic mail) or [[e-commerce]] (electronic commerce). ====Snake case==== {{main|Snake case}} {{blockquote|"the_quick_brown_fox_jumps_over_the_lazy_dog"}} Punctuation is removed and spaces are replaced by single [[underscore]]s. Normally the letters share the same case (e.g. "UPPER_CASE_EMBEDDED_UNDERSCORE" or "lower_case_embedded_underscore") but the case can be mixed, as in [[OCaml]] variant constructors (e.g. "Upper_then_lowercase").<ref>{{Cite web|url=http://caml.inria.fr/resources/doc/guides/guidelines.en.html|title=Caml programming guidelines|website=caml.inria.fr|language=en|access-date=2017-03-31}}</ref> The style may also be called ''pothole case'', especially in [[Python (programming language)|Python]] programming, in which this convention is often used for naming variables. Illustratively, it may be rendered ''snake_case'', ''pothole_case'', etc.. When all-upper-case, it may be referred to as ''screaming snake case'' (or ''SCREAMING_SNAKE_CASE'') or ''hazard case''.<ref name="Ruby" /> ====Kebab case==== {{blockquote|"the-quick-brown-fox-jumps-over-the-lazy-dog"}} Similar to snake case, above, except [[hyphen]]s rather than underscores are used to replace spaces. It is also known as '''spinal case''', '''param case''', '''Lisp case''' in reference to the [[Lisp (programming language)|Lisp programming language]], or '''dash case''' (or illustratively as '''kebab-case''', looking similar to the skewer that sticks through a [[kebab]]). If every word is capitalised, the style is known as '''train case''' (''TRAIN-CASE'').<ref>{{cite web |date=15 January 2023 |title=Programming naming conventions |website=Pluralsight |url=https://www.pluralsight.com/resources/blog/software-development/programming-naming-conventions-explained#train-case |at=11. Train case |access-date=16 November 2024 }}</ref> In [[CSS]], all property names and most keyword values are primarily formatted in kebab case. ==== Middot case ==== {{blockquote|"the路quick路brown路fox路jumps路over路the路lazy路dog"}} Similar to kebab case, above, except it uses [[interpunct]] rather than underscores to replace spaces. Its use is possible in many programming languages supporting Unicode identifiers, as unlike the hyphen it generally doesn't conflict with a reserved use for denoting an operator, albeit exceptions such as [[Julia (programming language)|Julia]] exist.<ref>{{Cite web |title=Variables 路 The Julia Language |url=https://docs.julialang.org/en/v1/manual/variables/ |access-date=2025-03-28 |website=docs.julialang.org |language=en}}</ref> Its lack of visibility in most standard keyboard layouts certainly contribute to its infrequent employ, though most modern input facility allow to reach it rather easily.<ref>{{Cite web |title=What is the meaning of an interpunct (路) in C? |url=https://stackoverflow.com/questions/15396199/what-is-the-meaning-of-an-interpunct-in-c |access-date=2025-03-28 |website=Stack Overflow |language=en}}</ref>
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)