ArticleslgStudy

science

Backslash

Backslash is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Backslash rather than just read about it. In short: The backslash \ is a typographical mark used mainly in computing and mathematics. It is the mirror image of the common slash ('solidus'), /.

Backslash — main illustration
Backslash — illustration

Key takeaways

  • Backslash belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Backslash to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Backslash from memory before moving on to harder problems.

Reference excerpt

The backslash \ is a typographical mark used mainly in computing and mathematics. It is the mirror image of the common slash ('solidus'), /. It is a relatively recent mark, first documented in the 1930s. It is sometimes called a hack, whack, escape (from C/UNIX), reverse slash, slosh, backslant, backwhack, bash, reverse slant, reverse solidus, and reversed virgule.

History

What may be the first documented reference to the character is a 1937 maintenance manual from the Teletype Corporation, which includes a photograph showing the keyboard of its Kleinschmidt keyboard perforator WPE-3 using the Wheatstone system. In a 1945 document, Teletype used the name "diagonal key" for the symbol, and gives it a (non-standard) Morse code of ▄ ▄▄▄ ▄ ▄ ▄▄▄ . Neither document gives its usage. In June 1960, IBM published an "Extended character set standard" that includes the symbol at 0x19. In September 1961, IBM's Bob Bemer proposed to the X3.2 standards committee that the characters [, ], and \ be made part of the proposed standard, describing the backslash as a "reverse division operator" and citing its prior use by Teletype in telecommunications. In particular, he said, the \ was needed so that the ALGOL Boolean operators ∧ (logical conjunction) and ∨ (logical disjunction) could be composed using /\ and \/ respectively. The Committee adopted these changes into the draft American Standard (subsequently called ASCII) at its November 1961 meeting. These operators were used for min and max in early versions of the C programming language supplied with Unix V6 and V7.

Usage

Programming languages In many programming languages such as C, Perl, PHP, Python and Unix scripting languages, and in many file formats such as JSON, the backslash is used as an escape character, to indicate that the character following it should be treated specially (if it would otherwise be treated literally), or literally (if it would otherwise be treated specially). For instance, inside a C string literal the sequence \n produces a newline byte instead of an 'n', and the sequence \" produces an actual double quote rather than the special meaning of the double quote ending the string. An actual backslash is produced by a double backslash \\. Regular expression languages used it the same way, changing subsequent literal characters into metacharacters and vice versa. For instance \||b searches for either '|' or 'b', the first bar is escaped and searched for, the second is not escaped and acts as an "or". Outside quoted strings, the only common use of backslash is to ignore ("escape") a newline immediately after it. In this context it may be called a "continued line" as the current line continues into the next one. Some software replaces the backslash+newline with a space. To support computers that lacked the backslash character, the C trigraph ??/ was added, which is equivalent to a backslash. Since this can escape the next character, which may itself be a ?, the primary modern use may be for code obfuscation. Support for trigraphs in C++ was removed in C++17, and support for them in C was removed in C23. In Visual Basic (and some other BASIC dialects) the backslash is used as an operator symbol to indicate integer division. This rounds toward zero. In APL \ is called Expand when used to insert fill elements into arrays, and Scan when used to produce prefix reduction (cumulative fold). In PHP version 5.3 and higher, the backslash is used to indicate a namespace. In Haskell, the backslash is used both to introduce special characters and to introduce lambda functions (since it is a reasonable approximation in ASCII of the Greek letter lambda, λ).

Filenames MS-DOS 2.0, released 1983, copied the idea of a hierarchical file system from Unix and thus used the (forward) slash as the directory separator. Possibly on the insistence of IBM, Microsoft added the backslash to allow paths to be typed at the command line interpreter prompt, while retaining compatibility with MS-DOS 1.0 (in which / was the command-line option indicator. Typing "DIR/W" gave the "wide" option to the "DIR" command, so some other method was needed if one actually wanted to run a program called W inside a directory called DIR). Except for COMMAND.COM, all other parts of the operating system accept both characters in a path, but the Microsoft convention remains to use a backslash, and APIs that return paths use backslashes. In some versions, the option character can be changed from / to - via SWITCHAR, which allows COMMAND.COM to preserve / in the command name. The Microsoft Windows family of operating systems inherited the MS-DOS behavior and so still support either character – but individual Windows programs and sub-systems may, wrongly, only accept the backslash as a path delimiter, or may misinterpret a forward slash if it is used as such. Some programs will only accept forward slashes if the path is placed in double-quotes. The failure of Microsoft's security features to recognize unexpected-direction slashes in local and Internet paths, while other parts of the operating system still act upon them, has led to some serious lapses in security. Resources that should not be available have been accessed with paths using particular mixes, such as http://example.net/secure\private.aspx.

Text markup The backslash is used in the TeX typesetting system and in RTF files to begin markup tags. In USFM, the backslash is used to mark format features for editing Bible translations. In caret notation, ^\ represents the control character 0x1C, File Separator.

Mathematics A backslash represents set difference in mathematics; a dedicated backslash-like symbol U+2216 ∖ SET MINUS is defined in Unicode. The backslash is also sometimes used to denote the right coset space. Especially when describing computer algorithms, it is common to define backslash so that a\b is equivalent to ⌊a/b⌋. This is integer division that rounds down, not towards zero. In MATLAB and GNU Octave the backslash is used for left matrix divide, while the (forward) slash is for right matrix divide.

… excerpt ends here. Continue reading the full article.

Illustrations

Backslash: Teletype ASR-33 keyboard layout with ASCII character set, prior to June 14, 1966, with backslash on shift+L
Teletype ASR-33 keyboard layout with ASCII character set, prior to June 14, 1966, with backslash on shift+L

Worked examples

Example 1 — a first encounter with Backslash

Start with the simplest possible case. Write down what Backslash claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Backslash before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Backslash ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Backslash

In research
Backslash appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Backslash in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Backslash is common in secondary-school and first-year university syllabi. It links to neighbouring topics Punctuation, Typographical symbols, so understanding it makes those chapters shorter.
In everyday life
Look for Backslash outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Backslash” →

How to study Backslash in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Backslash means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Backslash out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Backslash in simple terms?

The backslash \ is a typographical mark used mainly in computing and mathematics. It is the mirror image of the common slash ('solidus'), /.

Why does Backslash matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Backslash?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Backslash.

Tags

  • Punctuation
  • Typographical symbols

Keep exploring