Underscore

The symbol underscore ( _ ), also called underline, underdash, low line, or low dash, is a character that originally appeared on the typewriter and was primarily used to underline words. To produce an underlined word, the word was typed, the typewriter carriage was moved back to the beginning of the word, and the word was overtyped with the underscore character.

This character is often used to create visual spacing within a sequence of characters, where a whitespace character is not permitted (e.g., in computer filenames, email addresses, and in Internet URLs). Some computer applications will automatically emphasize text surrounded by underscores either by underlining or by italicizing it (e.g. `_string_` may render string or string). In contexts where no formatting is supported such as in IRC, instant messaging, or older email formats, the underscore markup is sometimes used as a proxy.

The underscore is not the same character as the dash character, although one convention for text news wires is to use an underscore when an em-dash or en-dash is desired, or when other non-standard characters such as bullets would be appropriate. A series of underscores (like __________ ) may be used to create a blank to be filled in on a form, although the resulting blank may have tiny gaps between each individual underscore. It is also sometimes used to create a horizontal line; other symbols with similar graphemes, such as hyphens and dashes, are also used for this purpose.

## Contents

* 1 Unicode encoding and typing
* 2 Diacritic
* 3 Usage in computing
* 3.1 History
* 3.2 Programming conventions
* 4 See also
* 5 References

## Unicode encoding and typing

In Unicode, the character is encoded at U+005F _ LOW LINE (HTML `&#95;` · spacing character). The ASCII value of this character is 95. On the standard US or UK 101/102 computer keyboard it shares a key with the hyphen-minus (-) on the top row, to the right of the 0 key.

A similar Unicode character is U+2017 ‗ DOUBLE LOW LINE, which is an underscore with two horizontal lines instead of one.

## Diacritic

The underscore is used as a diacritic mark, "combining low line", in some languages of Egypt, some languages using the Rapidolangue orthography in Gabon, Izere in Nigeria, and indigenous languages of the Americas such as Shoshoni and Kiowa.

## Usage in computing

### History

As early output devices (both CRTs and printers) could not produce more than one character at a location, it was not possible to underscore text, so common character sets of the 1950s had no underscore. IBM's EBCDIC character-coding system, introduced in 1964, added the underscore, which IBM referred to as the "break character". IBM's report on NPL (the early name of what is now called PL/I) leaves the character set undefined, but specifically mentions the break character, and gives `RATE_OF_PAY` as an example identifier.[1] By 1967 the underscore had spread to ASCII,[2] replacing the similarly-shaped left-arrow character (←) previously residing at code point 95 (5F hex) in ASCII-1963 (see also: PIP). C, developed at Bell Labs in the early 1970s, allowed the underscore as an alphabetic character.[3]

Underscore predates the existence of lower-case letters in many systems, so often it had to be used to make multi-word identifiers, as CamelCase (see below) was not available.

### Programming conventions

Underscores inserted between letters are very common to make a "multi word" identifier in languages that cannot handle spaces in identifiers. This convention is known as "snake case" (the other popular method is called camelCase, where capital letters are used to show where the words start).

An underscore as the first character in an ID is often used to indicate internal implementation that is not considered part of the API and should not be called by code outside that implementation. Python uses this for private member variables of classes, this is common in other languages such as C++ even though those provide keywords to indicate that members are private. It is extensively used to hide variables and functions used for implementations in header files. In fact the use of single underscore for this became so common that C compilers had to standardize on a double leading underscore (for instance `__DATE__`) for actual built-in variables to avoid conflicts with the ones in header files. Python uses double underscore to "mangle" a private id to make it much harder to refer to it, and "PHP reserves all function names starting with __ as magical."[4]

A variable named with just an underscore often has special meaning. `$_` or `_` is the previous command or result in many interactive shells, such as those of Python, Ruby, and Perl. In Perl, `@_` is a special array variable that holds the arguments to a function. In Clojure, it indicates an argument whose value will be ignored.[5]

In some languages with pattern matching, such as Prolog, Standard ML, Scala, OCaml, Haskell, Erlang and Wolfram Language, the pattern `_` matches any value, but does not perform binding.

## See also

* Space Character
* Overline
* Strikethrough
* Underline
* Undertie
* Visible space

## References

1. ↑ NPL Technical Report. IBM. 1964. p. 23. http://bitsavers.org/pdf/ibm/npl/320-0908_NPL_Technical_Report_Dec64.pdf. Retrieved 2011-06-09.
2. ↑ The Evolution of Character Codes, 1874-1968. http://www.trafficways.org/ascii/ascii.pdf. Retrieved 2016-11-16.
3. ↑ C Reference Manual. c. 1975. http://cm.bell-labs.com/cm/cs/who/dmr/cman.pdf. Retrieved 2011-06-09.
4. ↑ "Magic Methods". August 28, 2004. http://www.php.net/manual/en/language.oop5.magic.php.
5. ↑ Bozhidar Batsov. "The Clojure Style Guide". https://github.com/bbatsov/clojure-style-guide#underscore-for-unused-bindings. Retrieved 2019-09-05.

* v
* t
* e

Punctuation

* &
* ’ '
* *
* ⁂
* @
* \
* [ ] ( ) { } ⟨ ⟩
* •
* ^
* :
* ,
* 🄯
* ©
* † ‡ ⹋
* ‒ – —
* °
* ”〃
* = ⸗
* …
* !
* ❧
* .
* ‹ › « »
* -
* ‐
* ☞
* ·
* ‽
* ¡
* ¿
* ⸮
* ◊
* ×
* #
* №
* ÷
* º ª
* %
* ‰
* ‱
* ¶
* + −
* ± ∓
* ′ ″ ‴
* ?
* ‘ ’ “ ” ' ' " "
* ※
* ®
* §
* ;
* ℠
* /
* ℗
* ⁀
* ~
* ™
* _
* | ¦

* Currency symbols
* Diacritics
* Logic symbols
* Math symbols
* Whitespace

* Chinese punctuation
* Hebrew punctuation
* Japanese punctuation
* Korean punctuation

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Underscore. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Underscore&oldid=126194"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template