# Purpose of "Broken Bar" Character -- "|"

**URL:** <https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458>\
**Category:** Factual Questions\
**Created:** [March 31, 2004, 3:04am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458 "2004-03-31T03:04:46Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [October 28, 2015, 9:19pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/41 "2015-10-28T21:19:51Z")

</div>

> [@Senegoid](#):
>
> One of C’s famous problems, fixed in earlier languages before it ever even happened: FORTRAN use of = for assignment and .EQ. for comparison (and assignment didn’t produce a value like C does); Algol used := for assignment and = for comparison and had stronger type requirements. All subsequent languages that aspired to be taken seriously (e.g., Pascal, C++) likewise used one or both of these mechanisms. The most serious criticism of C here is that it carelessly introduced a problem that other _older languages already didn’t have._
> 
> ETA: FORTRAN II used integers for logical values, but FORTRAN IV had a native LOGICAL data type.

Huh? C also has different symbols for assignment and comparison. The first is =, the second is ==. Are you saying it originally used = for both?

As far as I know, a = b sets a to be the same as b, and then returns b.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [October 28, 2015, 9:26pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/42 "2015-10-28T21:26:37Z")

</div>

It’s BASIC which uses = for both. But that was an intentional simplification. Originally, a keyword LET was required for assignment. Later LET became optional, but assignment still had to be on its own line. BASIC didn’t allow expressions on their own line, so there was no ambiguity.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [October 28, 2015, 10:52pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/43 "2015-10-28T22:52:50Z")

</div>

The problem isn’t that C is trying to overload the symbol; the problem is that the structure of the language is such that one symbol (the = symbol) can masquerade as another (the == symbol). They are not the same, but if you’re not careful about what you type, they can look the same.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [October 28, 2015, 11:02pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/44 "2015-10-28T23:02:54Z")

</div>

The problem is what **Chronos** noted in Post #35, that C uses integers to represent boolean values, and thus can’t detect an error on statements like if( a = b) {…} when [del]maybe[/del] [del]probably[/del] almost certainly it should.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [November 2, 2015, 11:06pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/45 "2015-11-02T23:06:21Z")

</div>

> [@Senegoid](#):
>
> My above post raises another related question: Why did early computers seem to standardize on a 48-character set? A six-bit byte (common then) allows up to 64 characters. It seems that there was a fairly standard selection of 48 characters (letters, digits, 12 punctuation), and various computers had some varied selection of additional characters. Languages of the time constrained themselves to using the standard 48 characters, thus the entrenched standard of using \* for multiplication (and, in early languages including FORTRAN, the digraph \*\* for exponentiation).
> 
> Was the 48-character set due to some limitation on what could easily be encoded on IBM punched cards?

The IBM punch cards I think, something like 38 standard characters. Alphabet, Numbers and - /, out of 64 coding positions. Of which, I think, something like 45-48 were printable, so the standard “commercial” and “FORTRAN” printers were different in the other ~10 characters.

The limitation was the number of characters on the printer, and, less importantly, the number of keys on the keyboard.

---

<div class="post-metadata">

**Author:** ![yabob](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/yabob/32/2821_2.png) [@yabob](https://boards.straightdope.com/u/yabob)\
**Post date:** [November 3, 2015, 12:02am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/46 "2015-11-03T00:02:13Z")

</div>

> [@Melbourne](#):
>
> The IBM punch cards I think, something like 38 standard characters. Alphabet, Numbers and - /, out of 64 coding positions. Of which, I think, something like 45-48 were printable, so the standard “commercial” and “FORTRAN” printers were different in the other ~10 characters.
> 
> The limitation was the number of characters on the printer, and, less importantly, the number of keys on the keyboard.

Remember that the IBM punch card preceded digital computers by several decades. The character encoding used was designed to be processed by electromechanical tabulating devices. Hollerith developed his punch card tabulators in the late 19th century, initially to process census data. His company was later subsumed into IBM in the 1920s. The standard 80 column IBM card had 12 rows of punches per column, but the encoding was rather sparse to make electromechanical processing easy. In theory, you could have encoded 4096 different characters per column, but, as you observe only 64 combinations were legit, corresponding to 6 bit BCD.

[http://homepage.cs.uiowa.edu/~jones/cards/codes.html](http://homepage.cs.uiowa.edu/~jones/cards/codes.html)

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [November 3, 2015, 2:23am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/47 "2015-11-03T02:23:35Z")

</div>

> [@Melbourne](#):
>
> The IBM punch cards I think, something like 38 standard characters. Alphabet, Numbers and - /, out of 64 coding positions. Of which, I think, something like 45-48 were printable, so the standard “commercial” and “FORTRAN” printers were different in the other ~10 characters.
> 
> The limitation was the number of characters on the printer, and, less importantly, the number of keys on the keyboard.

A printer would certainly be designed to display whatever character set the rest of the computer used, not vice-versa. There were definitely 48 characters standardly in use (although there was some variability in what a few of the punctuation marks were, depending on whether it was intended for commercial or scientific use, and I suppose also for British vs American use).

The English alphabet (one case only) and digits were there: That’s 36

And 12 punctuation marks: space . , + - \* / ( ) $ and two others that I think were less standardized.

---

<div class="post-metadata">

**Author:** ![SpyOne](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@SpyOne](https://boards.straightdope.com/u/SpyOne)\
**Post date:** [November 3, 2015, 8:51am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/48 "2015-11-03T08:51:31Z")

</div>

> [@Blornx](#):
>
> IBM looked at the ASCII table and put keys for all of the printable characters onto its PC keyboard.

I was all set to call this bull, but … Now everything makes so much sense!

Every one of the weird characters that I’ve had on some non-standard computer’s keyboard had an ASCII value above 127. That is, they only appear in _extended_ ASCII.  
The standard old IBM 101-key keyboard has every printable character (and some unprintable ones) in the standard ASCII set.

---

<div class="post-metadata">

**Author:** ![SpyOne](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@SpyOne](https://boards.straightdope.com/u/SpyOne)\
**Post date:** [November 3, 2015, 9:13am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/49 "2015-11-03T09:13:26Z")

</div>

> [@Senegoid](#):
>
> We still haven’t gotten a clear answer to either of the OP’s questions: What this character was used originally used (or intended to be used) for, and why it was (and often still is) displayed as a broken bar. Then most nearly-plausible explanation given so far is the suggestion that business applications could use it for line-drawing, to produce printed tables of data.

It was already in use. It was used in math, it was useful for making tables, and there are symbols in there that make less sense.  
( I mean, do we really need both ` and ’ ?)

As for why the broken bar depiction, I think it seems quite plausible that was to distinguish it clearly from “I” and “l”. My current keyboard shows all the letters in bold, so the button for “|” shows a thinner line than “I” (which on the keyboard has no horizontal lines), but on older keyboards they would have looked the same.

---

<div class="post-metadata">

**Author:** ![amanset](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@amanset](https://boards.straightdope.com/u/amanset)\
**Post date:** [November 3, 2015, 3:33pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/50 "2015-11-03T15:33:03Z")

</div>

> [@SpyOne](#):
>
> ( I mean, do we really need both ` and ’ ?)

Well one is an accent and one is an apostrophe, so yeah.

In fact, if there is one thing that really gets to me it is when people use either `or ´as an apostrophe.

---

<div class="post-metadata">

**Author:** ![CalMeacham](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calmeacham/32/35_2.png) [@CalMeacham](https://boards.straightdope.com/u/CalMeacham)\
**Post date:** [November 3, 2015, 3:46pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/51 "2015-11-03T15:46:33Z")

</div>

In MathCAD the “|” key is used to denote a matrix. It’s a pretty useful one-stroke designator.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [November 3, 2015, 3:59pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/52 "2015-11-03T15:59:42Z")

</div>

> [@Senegoid](#):
>
> \*\*A printer would certainly be designed to display whatever character set the rest of the computer used, not vice-versa. \*\*There were definitely 48 characters standardly in use (although there was some variability in what a few of the punctuation marks were, depending on whether it was intended for commercial or scientific use, and I suppose also for British vs American use).
> 
> The English alphabet (one case only) and digits were there: That’s 36
> 
> And 12 punctuation marks: space . , + - \* / ( ) $ and two others that I think were less standardized.

Bolding mine.

In the early days of IBM line printers the printer mechanism had fewer printable symbols than the character encoding recognized/defined by the attached computer. So you’d have to install different print mechanisms to display different subsets of the total recognized character space.

Echoes of this same underlying issue existed for years in the form of MS-DOS and early Windows code pages. Even today with Unicode and all-graphical print & display, it’s still the case that not every font can display (= has a glyph for) every code point.

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [November 4, 2015, 2:52am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/53 "2015-11-04T02:52:50Z")

</div>

> [@Senegoid](#):
>
> A printer would certainly be designed to display whatever character set the rest of the computer used, not vice-versa. There were definitely 48 characters standardly in use (although there was some variability in what a few of the punctuation marks were, depending on whether it was intended for commercial or scientific use, and I suppose also for British vs American use).
> 
> The English alphabet (one case only) and digits were there: That’s 36
> 
> And 12 punctuation marks: space . , + - \* / ( ) $ and two others that I think were less standardized.

- was not a part of the standard character set until later. Even then not everybody used it: COBOL actually supported a 50-key keyboard (36+14), (the space bar wassn’t counted as a key), but it didn’t require the + symbol:

---

<div class="post-metadata">

**Author:** ![GiantRat](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@GiantRat](https://boards.straightdope.com/u/GiantRat)\
**Post date:** [November 4, 2015, 5:38am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/54 "2015-11-04T05:38:21Z")

</div>

I still use the pipe (digitally) in both \*nix and Win.

Og, that makes me feel old…

---

<div class="post-metadata">

**Author:** ![usedtobe](https://avatars.discourse-cdn.com/v4/letter/u/ec9cab/32.png) [@usedtobe](https://boards.straightdope.com/u/usedtobe)\
**Post date:** [November 4, 2015, 5:45am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/55 "2015-11-04T05:45:38Z")

</div>

Did someone just assert that COBOL did not require the ‘+’?

COMPUTE WS-PR1015-REC-CNT = WS-PR1015-REC-CNT + 1.

Was a valid statement for the years 1976-2001.

(yes, I did punch carriage control tapes for the IBM 1401 printer)

---

<div class="post-metadata">

**Author:** ![wolfpup](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolfpup/32/10618_2.png) [@wolfpup](https://boards.straightdope.com/u/wolfpup)\
**Post date:** [November 4, 2015, 12:11pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/56 "2015-11-04T12:11:05Z")

</div>

> [@Senegoid](#):
>
> A few of the standard characters got changed over the years. What we now see as a caret ^ character was originally an up-pointing arrow. What we now see as the underscore \_ character was originally a left-pointing arrow. That’s how they were printed on Teletypes older than about the early 1970’s or so.

Wonderfully nostalgic bit of trivia that I had long forgotten! Not only did the left arrow exist on those old Teletypes, but it was incorporated into the basic syntax of early versions of the PDP-10 timesharing OS when Teletypes were commonly used as timesharing terminals as well as the operator’s console. Copy and rename commands and such were of the form “COPY B←A” with destination first followed by that funny left-arrow and then the source. IIRC, with the demise of the left arrow, the OS took an equal sign instead, but the Teletype legacy survived in the device name TTY for any terminal. With the emergence of DOS and UNIX the intervening symbol on similar commands just became a space and the source and destination operands were reversed.

---

<div class="post-metadata">

**Author:** ![Leo\_Bloom](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/leo_bloom/32/10377_2.png) [@Leo\_Bloom](https://boards.straightdope.com/u/Leo_Bloom)\
**Post date:** [November 4, 2015, 2:07pm UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/57 "2015-11-04T14:07:15Z")

</div>

> [@wolfpup](#):
>
> …Copy and rename commands and such were of the form “COPY B←A” with destination first followed by that funny left-arrow and then the source. IIRC, with the demise of the left arrow, the OS took an equal sign instead, but the Teletype legacy survived in the device name TTY for any terminal. With the emergence of DOS and UNIX the intervening symbol on similar commands just became a space and the source and destination operands were reversed.

That formatting is an interesting way of thinking, for which a perfectly reasonable grapheme is used.

I remember a bunch of coders talking exactly about this point in a fairly recent thread, within a general discussion I think that started with Reverse Polish Notation. Is that correct? Or about a typology of programming languages using a criterion like the grammar represented by the [funny left arrow]?

In theories of programming, is there a word for that stricture? Surely scholars of computer programming have of comparative grammars of these languages with a comparable vocabulary for the “parts of speech.”

I don’t want to miss this opportunity of software heads together in one thread.  
ETA: And don’t call me Shirley.

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [November 5, 2015, 12:18am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/58 "2015-11-05T00:18:25Z")

</div>

> [@Senegoid](#):
>
> My above post raises another related question: Why did early computers seem to standardize on a 48-character set? A six-bit byte (common then) allows up to 64 characters. It seems that there was a fairly standard selection of 48 characters (letters, digits, 12 punctuation), and various computers had some varied selection of additional characters. Languages of the time constrained themselves to using the standard 48 characters, thus the entrenched standard of using \* for multiplication (and, in early languages including FORTRAN, the digraph \*\* for exponentiation).

They standardized on 48 _printable_ characters. There were actually more than that, but those were unprintable, control characters that were needed. Even ASCII retains that – 33 of the 128 characters are unprintable control characters (25%, about the same as in older codes).

Many of those codes are still used today: backspace, carriage return, line feed, etc. Even though they don’t produce a printable character, they are still needed in computer communications.

---

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [November 5, 2015, 12:26am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/59 "2015-11-05T00:26:35Z")

</div>

> [@Shalmanese](#):
>
> As to why, I believe it was to allow for the columular representation of data. Note the underscore character is introduced at the same time, allowing for primitive grid rendering. From there, it was incorporated into the EBCDIC encoding, then the ASCII encoding and then onto the standard 101-key keyboard layout.

I just want to highlight this post, since I would guess that it is the correct answer. Printing out tables would have been a very common early use of computers, so being able to represent horizontal and vertical lines as characters would have been highly useful.

```auto

______
| |
| Hi |
|----|
| Yo |
| ____ |

```

---

<div class="post-metadata">

**Author:** ![Melbourne](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Melbourne](https://boards.straightdope.com/u/Melbourne)\
**Post date:** [November 5, 2015, 1:11am UTC](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458/60 "2015-11-05T01:11:36Z")

</div>

> [@usedtobe](#):
>
> Did someone just assert that COBOL did not require the ‘+’?
> 
> COMPUTE WS-PR1015-REC-CNT = WS-PR1015-REC-CNT + 1.
> 
> Was a valid statement for the years 1976-2001.
> 
> (yes, I did punch carriage control tapes for the IBM 1401 printer)

COBOL included the + symbol in the supported 50 characters… It did not /rquire/ you to have a key-punch and printer that had the + key:: you could punch (and print) on existing equipment:

ADD 1 TO WS-PRIN1015-REC-CNT

It’s interesting to note that the language wars continue, and there are still (!) idiots 🙂 who argue that it is unatural to write

WS-PRIN1015-REC-CNT = WS-PRIN1015-REC-CNT + 5

and that you should write

WS-PRIN1015-REC-CNT += 5

because it’s more natural. – an argument that was already old 40 years ago.

[Previous page](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458.md?page=2)

[Next page](https://boards.straightdope.com/t/purpose-of-broken-bar-character/237458.md?page=4)
