Safekipedia

Backslash

Adapted from Wikipedia · Adventurer experience

An old keyboard from a Wheatstone Perforator, used for sending Morse code messages.

The backslash \ is a special symbol used mostly in computing and mathematics. It looks like the mirror image of the common slash ( / ), which is why it is sometimes called a reverse slash.

People have used many fun names for the backslash, like "hack," "whack," "slosh," or "backslant." In computer languages like C and UNIX, it is often called the "escape" character because it helps control special actions in coding.

Even though it looks simple, the backslash plays an important role in many computer systems and programs. It helps tell computers where files are stored and how to handle special symbols in code.

History

A Teletype Wheatstone Perforator keyboard from the 1930s, with backslash in the end of the third row

The backslash first appeared in a 1937 manual from the Teletype Corporation. It showed a picture of a special keyboard. In 1945, Teletype called it the “diagonal key.”

In 1960, IBM added the backslash to its character set. In 1961, an IBM employee suggested using it in a new standard, calling it a “reverse division operator.” This helped programmers use certain symbols in early computer languages.

Usage

In many programming languages such as C, Perl, PHP, Python, and Unix scripting languages, the backslash is used as an escape character. This means it changes how the next character is seen. For example, in C, \n makes a new line, and \" shows a real double quote.

In regular expression languages, the backslash changes normal characters into special ones and vice versa. For example, \||b looks for either '|' or 'b'.

In Visual Basic and some other BASIC languages, the backslash is used to show integer division.

In APL, the backslash has special meanings when used with arrays.

In PHP version 5.3 and higher, the backslash shows a namespace.

In Haskell, the backslash introduces special characters and lambda functions.

In MS-DOS and Microsoft Windows, the backslash is used in filenames to separate folders.

The backslash is also used in TeX typesetting and RTF files to start special formatting.

In mathematics, the backslash can show the difference between sets.

In MATLAB and GNU Octave, the backslash is used for a special kind of matrix divide.

Confusion with ¥ and other characters

In some computer systems in Japan, the symbol that looks like a backslash is shown as a yen sign (¥). This happens because these systems use different symbols, and the backslash’s spot shows the yen sign. This can be confusing when looking at old computer files.

Other countries also had similar issues. The backslash could look like different symbols, such as ₩ in Korea, Ö in Germany and Sweden, Ø in Denmark and Norway, ç in France, and Ñ in Spain. Today, these problems are less common, but some older systems can still cause this mix-up.

In 1991, a suggestion was made to use // instead of a backslash in internet standards to avoid confusion. You might see this in some older internet documents.

Unicode

Unicode has special symbols that look like the backslash. These symbols have special codes that help computers know how to display them. Some examples are the regular backslash, a larger version, and a box shape that runs from the top left to the bottom right.

Images

An old keyboard layout from the Teletype ASR-33 machine, showing how keys were arranged in the 1960s.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Backslash, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.