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

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.

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.

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.

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.

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

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.

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.

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.

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.

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

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.

  • 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:

     ADD  COST TO TAX GIVING PRICE
    

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

Og, that makes me feel old…

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)

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.

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.

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.

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.



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

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 :slight_smile: 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.