Seriously, at this point C should be considered dangerous and should be actively discouraged. I would even go so far as to legislate it. We can't have this sort of thing in 2019.
Please don't comment on the state of programming in 2019 if you're an Angular developer.
C, what the fuck??!
31–38 of 38 posts
Re: C, what the fuck??!
#32TL;DR: Trigraphs. That at least makes the ‘??!’ in the title meaningful. It's still clickbait, though.
Re: C, what the fuck??!
#33Digraphs were supposed to be a easier-to-read alternative to trigraphs. Unfortunately, the extended list of digraphs with many additional logic operators by C++ never entered C, i.e. %:%: ## compl ~ not ! bitand & bitor | and && or || xor ^ and_eq &= or_eq |= xor_eq ^= not_eq != C only has basic ones (still more intuitive than trigraphs). ] } %: # Last time, I had to type a C program on a touchscreen, and those symbo…
Re: C, what the fuck??!
#34The author purposely misleads the reader by doing syntax highlighting wrong. A trigraph-aware editor would keep the third line green.
Re: C, what the fuck??!
#35What is the probability of something like this appearing in a normal program written by somebody who is unaware of trigraphs? I am also not aware of any professional who would use multiple question marks in any kind of serious code that could be read by anybody else because that kind would reflect negatively on the perception of his professionalism.
I definitely add comments with tons of questions and potential trigraphs when I use punctuation in lieu of actual cursing. Don't get me wrong. I curse a lot in comments, too.
TL/DR: bad code -> angry comments
Re: C, what the fuck??!
#36What is the probability of something like this appearing in a normal program written by somebody who is unaware of trigraphs? I am also not aware of any professional who would use multiple question marks in any kind of serious code that could be read by anybody else because that kind would reflect negatively on the perception of his professionalism.
Pro dev here. I am working on a codebase that is large and juvenile. The original authors didn't know about functions or something; it's pure spaghetti PHP. I definitely add comments with tons of questions and potential trigraphs when I use punctuation in lieu of actual cursing. Don't get me wrong. I curse a lot in comments, too. TL/DR: bad code -> angry comments
However: https://www.jetbrains.com/help/phpstorm/refactoring-source-c... ?
Re: C, what the fuck??!
#37What is the probability of something like this appearing in a normal program written by somebody who is unaware of trigraphs? I am also not aware of any professional who would use multiple question marks in any kind of serious code that could be read by anybody else because that kind would reflect negatively on the perception of his professionalism.
Nice "No true Scotsman" logic there. Sure, if you see multiple question marks as an indicator of unprofessionalism, then by definition, no professional would use that. At the same time, your definition of professional is not one that is useful in any other context. In code written by people whose job it is, in part, to write code, i.e. what I would call professionals, multiple question marks do sometimes occur.
Re: C, what the fuck??!
#38Earlier quoted context omitted.
Trigraphs were not specific to EBCDIC: they were also a bad accommodation for the ISO 646 ASCII variants that supported European languages, which used characters {\|} etc. for letters. This is why the newer better header with alternate spellings for restricted character sets is called https://en.wikipedia.org/wiki/ISO/IEC_646
The reasonable accommodation is to substitute with characters that are available in the ISO 646 ASCII variant being used, preferably the characters with the same binary representation as in US ASCII. Outside of silly games like IOCCC, did anybody actually use trigraphs? I find it really hard to believe that anybody tolerated trigraphs for serious C programming. Was there an obscure European government agency that act…
From http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n291...
> The biggest argument against deprecating trigraph is the fact that we know there are source code from world-wide companies, based on an internal survey of our customer problem reports that make heavy use of trigraphs for one reason or another, and customer testimonials. Google code search doesn't find them because these are proprietary code. Further discussions with some of these customers have shown serious dissatisfaction with WG21’s intention to deprecate trigraphs, because they do not wish to make any changes to their source code. It doesn't seem fair to force this group of existing users to change their source code for no apparent benefit, other then reducing an annoyance to another group.
ISO 646 is probably nowhere near as relevant to their argument as EBCDIC is.
> Trigraph deprecation is vexing for existing world-wide companies (of which IBM is one such user) because of their use of EBCDIC variant code pages. It makes it difficult to start in a code page neutral manner, establish what the active code page is, then start using invariant characters. We use a pragma filetag("IBM-1047") to toggle the code page, then we can use #. Prior to that we are in a code page neutral environment and must use the trigraph ??=