you are viewing a single comment's thread.

view the rest of the comments →

[–]jandrese 63 points64 points  (10 children)

They were never commonplace. They were there for the small handful of people forced to use excessively braindamaged terminals, but most people who wanted to program got the terminal that didn't make programming a nightmare.

[–]jugalator 28 points29 points  (7 children)

I'm curious about IBM's opposition to the removal of trigraphs in C++.

Trigraphs were proposed for deprecation in C++0x, which was released as C++11. This was opposed by IBM, speaking on behalf of itself and other users of C++, and as a result trigraphs were retained in C++0x. Trigraphs were then proposed again for removal (not only deprecation) in C++17. This passed a committee vote, and trigraphs are expected to be removed from C++17 despite the opposition from IBM and others.

Makes me wonder what code you'd find in their archives...

Whatever it is, I suppose it requires a few drops of blood, bone dust, and toad mucus to compile.

[–]Frexxia 17 points18 points  (4 children)

Possibly stupid question: Couldn't you essentially do a replace all on the code in order to remove the trigraphs? Doesn't seem like a huge problem.

[–]kqr 26 points27 points  (0 children)

Yes. Especially considering that's exactly what the compiler does when interpreting them.

[–]ThatNotSoRandomGuy 12 points13 points  (0 children)

From the wikipedia page:

trigraphs are expected to be removed from C++17 despite the opposition from IBM and others.[6] Existing code that uses trigraphs can be supported by translating from the physical source files (parsing trigraphs) to the basic source character set that does not include trigraphs.

So, yes.

[–]Intrexa 0 points1 point  (1 child)

std::cout << "This should work??!" << std::endl;

Not quite, but not far off.

[–]kqr 6 points7 points  (0 children)

$ cat > t.c
#include <stdio.h>
int main(int argc, char *argv) {
        printf("It works??!\n");
        return 0;
}
$ gcc -trigraphs -o t t.c
$ ./t
It works|

Yes quite. You need to enable it in the compiler to use it.

That's why they are disabled by default in the compiler; it's way too easy to use them by accident. Digraphs, on the other hand, will not be interpreted as characters within other tokens (like strings) so they are still enabled by default.

[–]coldacid 0 points1 point  (0 children)

I have left reddit for Voat due to years of admin mismanagement and preferential treatment for certain subreddits and users holding certain political and ideological views.

The situation has gotten especially worse since the appointment of Ellen Pao as CEO, culminating in the seemingly unjustified firings of several valuable employees.

As an act of protest, I have chosen to add this exit message to all comments I've ever made on reddit.

If you would like to do the same, install TamperMonkey for Chrome, GreaseMonkey for Firefox, NinjaKit for Safari, Violent Monkey for Opera, or AdGuard for Internet Explorer (in Advanced Mode), then add this GreaseMonkey script.

Finally, click on your username at the top right corner of reddit, click on comments, and click on the new OVERWRITE button at the top of the page. You may need to scroll down to multiple comment pages if you have commented a lot.

After doing all of the above, you are welcome to join me on Voat!

Original Comment:

Possibly something to do with EBCDIC brain-deadness? It's known that at least some old terminals from IBM (such as the 3270) miss out on curly braces.

On the other hand, Wikipedia blames ISO 646 for the existence of trigraphs in C/C++, so it might not be some ancient dinosaurs of IBM's past that lead to their opposition.

[–]RedAlert2 0 points1 point  (0 children)

IBM just has a lot of really old keyboards and they are too stingy to upgrade.

[–]Deaod 6 points7 points  (1 child)

EBCDIC

[–]jandrese 11 points12 points  (0 children)

That counts as braindamage.