Slashdot Mirror


Symbolic vs. Mnemonic Relational Operators: Is "GT" Greater Than ">"?

theodp writes: "Mnemonic operators," writes SAS's Rick Wicklin as he weighs the pros-and-cons of Symbolic Versus Mnemonic Logical Operators, "tend to appear in older languages like FORTRAN, whereas symbolic operators are common in more recent languages like C/C++, although some relatively recent scripting languages like Perl, PHP, and Windows PowerShell also support mnemonic operators. SAS software has supported both operators in the DATA step since the very earliest days, but the SAS/IML language, which is more mathematically oriented, supports only the symbolic operators. Functionally, the operators are equivalent, so which ones you use is largely a matter of personal preference. Since consistency and standards are essential when writing computer programming, which operators should you choose?"

4 of 304 comments (clear)

  1. Re:Do anything other than what Perl did by nogginthenog · · Score: 5, Funny

    ^ This

    Not This?

  2. Re:The problem is using operators for other things by johnw · · Score: 5, Insightful

    It's one thing to use ">" for "less than".

    That would be almost bound to cause confusion.

  3. Re:Is it really a waste of time? by nmb3000 · · Score: 5, Insightful

    We could say ">", "GT" or "gt", or perhaps even "greater than."

    I disagree. I believe > is easier to parse while reading code since it separates it from identifiers, control statements, constants, numbers, and other keywords. It's the same reason && is better than "AND" in C syntax derivatives.

    I'd be quite pleased with a language that understood all three to be the same thing, with similar broad expression capabilities for everything else as well.

    Please, no. Syntactic sugar is one thing but creating multiple equivalent ways to express the same thing is just a readability, support, and maintenance nightmare.

    explicit and English-like for the newcomer.

    Which is how we got COBOL. It turned out that just making source code use lots (and lots) of English words isn't enough to allow laymen to understand it or make changes, so all you end up with is a language that programmers find exhausting to read and annoying to write.

    --
    "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
    /)
  4. Re:Typing versus Reading by Waffle+Iron · · Score: 5, Interesting

    On the other hand, students and people in-general have gotten > and < confused for a long time.

    Many decades ago, my first grade teacher explained that these symbols are like alligators: They choose to chomp on the bigger meal. I've never been confused on these symbols since that day.