Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Friday August 02 2019, @01:03PM   Printer-friendly
from the ASCII-and-you-will-receivii? dept.

https://bestasciitable.com/

To understand why Control+i inserts a Tab in your terminal you need to understand ASCII, and to understand ASCII you need know a bit about its history and the world it was developed in. Please bear with me (or just go the table).

Teleprinters

Teleprinters evolved from the telegraph. Connect a printer and keyboard to a telegraph and you've got a teleprinter. Early versions were called "printing telegraphs".

Most teleprinters communicated using the ITA2 protocol. For the most part this would just encode the alphabet, but there are a few control codes: WRU ("Who R U") would cause the receiving teleprinter to send back its identification, BEL would ring a bell, and it had the familiar CR (Carriage Return) and LF (Line Feed).

This is all early 20th century stuff. There are no electronic computers; it's all mechanical working with punched tape. ITA2 (and codes like it) were mechanical efficient; common letters such as "e" and "t" required only a single hole to be punched.

These 5-bit codes could only encode 32 characters, which is not even enough for just English. The solution was to add the FIGS and LTRS codes, which would switch between "figures" and "letters" mode. "FIGS R W" would produce "42". This worked, but typo'ing a FIGS or LTRS (or losing one in line noise) would result in gibberish. Not ideal.

Terminals

In the 1950s teleprinters started to get connected to computers, rather than other teleprinters. ITA2 was designed for mechanical machines and was awkward to use. ASCII was designed specifically for computer use and published in 1962. Teleprinters used with computers were called terminals (as in "end of a connection", like "train terminal"). Teleprinters were also called "TeleTYpewriter", or TTY for short, and you can still find names like /dev/tty or /bin/stty on modern systems.


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 1) by mordac on Friday August 02 2019, @03:50PM (4 children)

    by mordac (6108) on Friday August 02 2019, @03:50PM (#874675)

    The article explains why ctrl+I sends ASCII 0x09. I think I figured out the relationship between upper case, lower case and control characters when I was about 14.

    I was hoping for the reason why TAB is ASCII 0x09 as opposed to any other value.

  • (Score: 2) by Arik on Friday August 02 2019, @04:21PM

    by Arik (4543) on Friday August 02 2019, @04:21PM (#874691) Journal
    As far as I know there was no specific significance to 9 = tab specifically. However the characters were not just randomly assigned; there was a scheme to it. If you picture the usable space as an array it looks something like this:

    https://en.wikipedia.org/wiki/File:USASCII_code_chart.png

    You'll notice that the first couple of columns, characters beginning with 0 or 1, are all control characters of one kind or another. We have the horizontal tab and vertical tab and line feed and form feed and carriage return (all used for moving the printhead, then later the cursor, around before you print a visible character) and even the bell there in the first two columns, spilling over just barely into the third column before we get to the special characters, numbers, uppercase then lower case letters, and a few more special characters thrown in at the end. So placing it at 9 may have been more or less arbitrary, but placing it somewhere between 0 and 20 was at least predictable.
    --
    If laughter is the best medicine, who are the best doctors?
  • (Score: 0) by Anonymous Coward on Friday August 02 2019, @04:40PM

    by Anonymous Coward on Friday August 02 2019, @04:40PM (#874703)

    This may be the closest you are going to get for the "why" is Tab ascii 9 ?
    https://web.archive.org/web/20050204103202/http://www.bobbemer.com/FATHEROF.HTM [archive.org]

    A Google search of the Web for "Father of ASCII" currently yields some 100 hits, all referring to this author.

    Main page (now taken down, since he died some time back) --
    https://web.archive.org/web/20050129084302/https://www.bobbemer.com/ [archive.org]

  • (Score: 0) by Anonymous Coward on Friday August 02 2019, @05:37PM

    by Anonymous Coward on Friday August 02 2019, @05:37PM (#874726)

    I was hoping for the reason why TAB is ASCII 0x09 as opposed to any other value.

    Best guess: completely arbitrary. The designers needed to assign "control codes", and only two were 'special' as far as their numeric values (null == all zeros, del == all ones).

    The remainder were probably just "assigned", and it just happened that "tab" got assigned to the number 9.

  • (Score: 0) by Anonymous Coward on Friday August 02 2019, @05:39PM

    by Anonymous Coward on Friday August 02 2019, @05:39PM (#874727)

    I was hoping for the reason why TAB is ASCII 0x09 as opposed to any other value.

    You will find that you'll get better answers when you ask the question you really want answered up front.

    Asking why tab was not assigned to the T key is not the same as asking why tab was given the numeric value 9.