1. 10
  1. 3

    I actually prefer to use and, or, not. It makes the code more readable.

    1. 3

      I feel like it’s one of those things where it depends on the audience. To someone unfamiliar with C-based languages, it seems more readable. To people fluent with the language, it’s very off-putting. C’s pattern of using punctuation for built-in operators means that words are nearly always variables, types, functions, or control-flow statements. (Nearly always – there are some exceptions, like sizeof.) Breaking that pattern may make the code more readable for some, but not for me.

      1. 3

        In C++, you already have things like unique_ptr<int> replacing int*, so why not replace other things with words too? Also, if you have something like if (!condition), the exclamation mark is very hard to overlook, which is another aigument for using not.

    2. 1

      I have a coworker who keeps using not and and operators and such in his code. Threw me for a hell of a loop when I first saw it. I have no idea how to make him stop, since he actually is far, far better at C++ than I am. XD

      Also, didn’t C officially deprecate the digraphs and such at some point recently?

      1. 4

        Trigraphs got removed … I didn’t know about the digraphs until now! They seem redundant with the trigraphs, though they’re less ugly and more mnemonic; maybe that was the point?

        I did know about “and” and “or”, and kind of like the way they look, but I’ve never used them for fear of sowing confusion.

        1. 3

          Digraphs are not redundant – they were introduced specifically so that trigraphs could be removed. Trigraphs were universally despised because, unlike digraphs, they were translated wherever they appeared in the source code, including text within strings and comments. (This was necessary because the backslash was one of the characters for which trigraphs offered an alternate encoding.) Thus e.g. a string containing the text "Huh?!?" would pass unmolested, but the string "Huh??!" would silently be transformed into "Huh|" – sometimes to hilarious effect.

        2. 4

          What exactly is the problem?

          1. 2

            Ask them why they are using unidiomatic operators that force all readers to do a double take?

            1. 1

              Ask the standard why it includes unidiomatic operators instead of blaming your colleague for using the standard?

            2. 1

              I have no idea how to make him stop

              Have you consider violence? What about extreme violence?