Backtick Explained

Mark:`
Backtick
Unicode: (symbol)
See Also: (diacritic)
Variant1:

The backtick is a typographical mark used mainly in computing. It is also known as backquote, grave, or grave accent.

The character was designed for typewriters to add a grave accent to a (lower-case) base letter, by overtyping it atop that letter.[1] On early computer systems, however, this physical dead key+overtype function was rarely supported, being functionally replaced by precomposed characters. Consequently, this ASCII symbol was rarely (if ever) used in computer systems for its original aim and became repurposed for many unrelated uses in computer programming.

The sign is located on the left-top of a US or UK layout keyboard, next to the key. On older keyboards, the Escape key was at this location, and the backtick key was somewhere on the right side of the layout. Provision (if any) of the backtick on other keyboards varies by national keyboard layout and keyboard mapping.

History

Typewriters

On typewriters designed for languages that routinely use diacritics (accent marks), there are two possible solutions. Keys can be dedicated to pre-composed characters or alternatively a dead key mechanism can be provided. With the latter, a mark is made when a dead key is typed but, unlike normal keys, the paper carriage does not move on and thus, the next letter to be typed is printed under the accent.

Incorporation into ISO 646 and ASCII

The incorporation of the grave symbol into ASCII is a consequence of this prior existence on typewriters. This symbol did not exist independently as a type or hot-lead printing character.

Thus, ISO646 was born and the ASCII standard updated to include the backtick and other symbols.

As surrogate of apostrophe or (opening) single quote

Some early typewriters and ASCII peripherals designed the backtick and apostrophe to be mirror images of each other.[2] This allowed them to be used as matching pairs of open and close quotes, and also as grave and acute accents, and allowed the apostrophe to be used as a prime. None of these were considered typographically correct.

The use of apostrophe for opening quotes, the need on some typewriters to overprint apostrophe and period to get an exclamation mark, and the lack of a mirrored double-quote character, tended to change the apostrophe to the modern "typewriter" design that is vertical, so this no longer works. Unicode now provides separate characters for opening and closing quotes.

Such style is sometimes used even nowadays; examples are: output generated by some UNIX console programs, rendering of man pages within some environments, technical documentation written long ago or written in old-school manner. However, as time goes on, such style is used less and less, and even institutions that traditionally were using that style are now abandoning it.[3] [4]

Computing

Command-line interface languages

Many command-line interface languages and the scripting (programming) languages like Perl, PHP, Ruby and Julia (though see below) use pairs of backticks to indicate command substitution. A command substitution is the standard output from one command, into an embedded line of text within another command.[5] [6] For example, using $ as the symbol representing a terminal prompt, the code line:

In Bash and Zsh, the use of backticks for command substitution is now largely deprecated in favor of the notation $(...), so that the example above would be re-written:

The new syntax allows nesting, for example:

Markup languages

It is sometimes used in source code comments to indicate code, e.g.,

/* Use the `printf` function. */

This is also the format the Markdown formatter uses to indicate code.[7] Some variations of Markdown support "fenced code blocks" that span multiple lines of code, starting (and ending) with three backticks in a row (```).[8]

Programming languages

const name = "Mary", pet = "lamb"; // Set variableslet temp = `$ has a little $!`; console.log(temp); // => "Mary has a little lamb!";

Games

In many PC-based computer games in the US and UK, the key is used to open the console so the user can execute script commands via its CLI. This is true for games such as Factorio, Battlefield 3, Half-Life, Halo CE, Quake, Half-Life 2, Blockland, , Unreal, Counter-Strike, Crysis, Morrowind, Oblivion, Skyrim,[10] , Fallout 3, Fallout 4, RuneScape, and games based on the Quake engine or Source engine. While not necessarily the original progenitor of the console key concept, Quake is still widely associated with any usage of the key as a toggle for a drop-down console, often being referred to as the "Quake Key". In 2021, Windows Terminal introduced a "Quake Mode" which enables a global shortcut of + that opens a terminal window pinned to the top half of the screen.[11]

See also

Notes and References

  1. Web site: Markus . Kuhn . Apostrophe and acute accent confusion . This key is on German typewriters a non-spacing key (DIN 2137). It does not advance the cursor, but causes the next character to appear below the accent . Department of Computer Science and Technology, University of Cambridge.
  2. Web site: Markus . Kuhn . ASCII and Unicode quotation marks . Please do not use the ASCII grave accent as a left quotation mark . Department of Computer Science and Technology, University of Cambridge.
  3. Web site: In the C locale, the output of GNU programs should stick to plain ASCII for quotation characters in messages to users: preferably 0x22 (‘"’) or 0x27 (‘'’) for both opening and closing quotes. Although GNU programs traditionally used 0x60 (‘`’) for opening and 0x27 (‘'’) for closing quotes, nowadays quotes ‘`like this'’ are typically rendered asymmetrically, so quoting ‘"like this"’ or ‘'like this'’ typically looks better. . GNU Coding Standards: Quote Characters . GNU Coding Standards . . 19 February 2019 . 12 March 2019.
  4. Web site: makeinfo should quote 'like this' instead of `like this' . Paul . Eggert . 23 January 2012 . bug-texinfo Archives . 27 March 2018.
  5. Web site: Command Substitution. wooledge.org. 2024-08-06.
  6. Web site: An Introduction to the Z Shell – Command/Process Substitution. zsh.sourceforge.net. 27 March 2018.
  7. Web site: Daring Fireball: Markdown Syntax Documentation.
  8. Web site: GitHub Flavored Markdown Spec . 23 February 2022 . https://web.archive.org/web/20220221045705/https://github.github.com/gfm/#fenced-code-blocks . 21 February 2022 . live.
  9. Web site: Template literals (Template strings). MDN Web Docs. en. 2019-05-22.
  10. Web site: Skyrim:Console . UESPWiki . 15 November 2019.
  11. Web site: Cinnamon . Kayla . Windows Terminal Preview 1.9 Release . devblogs.microsoft.com . 5 June 2023.