3 ms·
I think my favorite C trigraph was something like do_action() ??!??! handle_error() It almost looks like special error handling syntax but still remains sat
by TomatoCo 2y ago
I think my favorite C trigraph was something like
do_action() ??!??! handle_error()
It almost looks like special error handling syntax but still remains satisfying once you realize it's an || logical-or statement and it's using short circuiting rules to execute handle error if the action returns a non-zero value.
- wslh 2y agoDid you choose the legacy C trigraphs over || for aesthetic purposes?
- wslh 2y agoCould you review my comment on HN? Please educate me if there is something I haven’t understood, rather than downvoting my question.
- samatman 2y agoThe grandparent post is specifically about trigraphs. Saying something about trigraphs was the end-in-itself, trigraphs were chosen to illustrate something about trigraphs. So your question made no sense. Hope that helps.
- Izkata 2y agoMaybe the confusion was the other way, more like "why is that funny/interesting?" An attempt to answer that: In English, mixing ?! at the end of a question is a way of indicating bewilderment. Like "What was that?!"
- wslh 2y agoMy question was precisely about why the user like trigraphs over using just || on this case. It is a very clear question and makes all the sense.
- teo_zero 2y agoI didn't downvote your comment but understand why it looks "wrong": it's like, in a thread on English oddities, you replied to someone bringing up the "buffalo buffalo buffalo" example with the question "why are you so fond of bovines"?
- wslh 2y agoIt has nothing to do with that. I could ask why he didn't choose a different homonymic ambiguity [1]. [1] https://journals.linguisticsociety.org/proceedings/index.php/BLS/article/view/2327/2097 https://journals.linguisticsociety.org/proceedings/index.php...
- kergonath 2y agoThe post shows a “favorite C trigraph” thing, not that they were going out of their way to use trigraphs in actual code or that you should. Using trigraphs is the whole premise so no, your question makes no sense in that context. FWIW the ??!??! double trigraph as error processing is funny because of the meaning of ?! and various combinations of ? and !. It is funny and it has trigraphs. That’s the whole point.
- mstade 2y agoMy reading of the downvoted question was one of genuine curiosity of why the author chose that as a favorite trigraph, as in “why that one instead of another”, not as criticism of the choice of trigraph over something more conventional. I may be wrong of course, but it didn’t seem like a particularly malicious question to me and your rationale unfortunately doesn’t convince me otherwise. Not that it has to, this is all very subjective after all, but just offering up a counter opinion. I gave the question a +1 because I, as previously stated, read it to be genuine curiosity. Maybe a smiley would’ve helped, I don’t know. ¯\_(ツ)_/¯
- wslh 2y ago> The post shows a “favorite C trigraph” thing, not that they were going out of their way to use trigraphs in actual code or that you should. But I am free to be curious and ask the author why he choose it! We are not computers but human beings! There is no HN rule that says that I cannot be curious and asks a question that arised from a thread but it is not connected to that! [1]. [1] https://www.iflscience.com/charles-babbage-once-sent-the-most-pedantic-letter-to-tennyson-mathematically-correcting-his-poem-59618 https://www.iflscience.com/charles-babbage-once-sent-the-mos...
- JadeNB 2y ago> So your question made no sense. Hope that helps. I think that is uncharitable. The question ("Did you choose the legacy C trigraphs over || for aesthetic purposes?") makes perfect sense to me. I think context makes it reasonably clear that the answer is 'yes,' but that doesn't mean that the question doesn't make sense, only perhaps that it didn't need to be asked.
- James_K 2y agoEasiest way to get downvotes is to ask people not to give them. You just gotta ignore the haters.
- TomatoCo 2y agoNo, I don't really write C. I was remarking on something I saw once and I wanted to share it because the original article mentions trigraphs.
- jacobn 2y agohttps://en.wikipedia.org/wiki/Digraphs_and_trigraphs_(programming)#C https://en.wikipedia.org/wiki/Digraphs_and_trigraphs_(progra... ??! Is converted to | So ??!??! Becomes || i.e. “or”