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?"

304 comments

  1. Wow, a paper about GT by astrojetsonjr · · Score: 1, Troll

    Guess he had spare time on his hands

    1. Re:Wow, a paper about GT by prunus.avium · · Score: 4, Interesting

      We're on /.. By definition we're all wasting time....usually instead of working.

      That being said, this raises some interesting questions about how our brains parse the languages. Would a mnemonic like GT be simpler to parse than >.

      Of course, I think this brings up the question of first language. Someone with English and the Latin alphabet may find the mnemonics easier but someone for whom the Latin alphabet is not their primary alphabet might handle the operators better.

    2. Re:Wow, a paper about GT by Kjella · · Score: 1, Insightful

      I guess we've met this guy. Apart from that, personally I'd like to ban the lone "=" operator so it's "==" for comparison, ":=" for assignment with all the other two char operators like != and += intact. So many languages try to be "smart" instead of just making the difference more explicit.

      --
      Live today, because you never know what tomorrow brings
    3. Re:Wow, a paper about GT by Anonymous Coward · · Score: 0

      Bah, just make the language smarter! = should be good for any usage whatsoever= =

    4. Re:Wow, a paper about GT by Anonymous Coward · · Score: 0

      Why didn't I pick a field where papers were this easy to shit out?

    5. Re:Wow, a paper about GT by grimmjeeper · · Score: 1

      Problem with that is C (and by derivation C++ and a number of other languages) allows you to use the value from an assignment as a right hand value. That allows both of these constructs:

      x = y = z = 5

      x = y == z = 5

      In the first line, all 3 variables are assigned the value 5. In the second, "z" is assigned the value 5. 5 is then compared to "y" and the truth of that comparison (0 or 1) is assigned to "x". You can't just use one operator for both assignment and comparison. It fundamentally breaks the language. Now, if you want to make your own language that does not allow the results of an assignment to be used as a right hand value (and there are many that don't already), you're more than welcome to do it.

    6. Re:Wow, a paper about GT by Anonymous Coward · · Score: 0

      Any half decent IDE will warn you, so it should be a nonissue.

    7. Re:Wow, a paper about GT by Anonymous Coward · · Score: 0

      The usual way of saying this is that in C assignment is an expression.

      Not entirely sure of the relevance of this anyway.

    8. Re:Wow, a paper about GT by Joce640k · · Score: 1

      I'd like to ban the lone "=" operator so it's "==" for comparison, ":=" for assignment with all the other two char operators like != and += intact. So many languages try to be "smart" instead of just making the difference more explicit.

      Here's a nickel, son. Go get yourself a proper compiler.

      --
      No sig today...
    9. Re:Wow, a paper about GT by fyngyrz · · Score: 1

      ban the lone "=" operator so it's "==" for comparison, ":=" for assignment with all the other two char operators like != and += intact

      It seems pointless to make "=" meaningless, and to replace it only with something more difficult to write, while no more visually distinct.

      = and == seem to me to be perfectly reasonable, no more visually or conceptually obscure than ":=" and "==", and with the bonus of being easier to write.

      C does it right, in my view: comparison is explicit; assignment can be overloaded as truth comparison. The reason I consider that a good thing is because computers can do both at one time; since they can do it, it is valuable being able to provide a way to tell them to do it. It makes for higher quality code generation, and code generation that is more aligned with precise intent.

      For a higher level language, it's less critical. But for high performance situations, this is one of those things that get us "closer to the metal" in a very good way.

      --
      I've fallen off your lawn, and I can't get up.
    10. Re:Wow, a paper about GT by grimmjeeper · · Score: 4, Informative

      I would agree with you except for the horrendous number of hours wasted tracking down places where a single equal was used in place of a double. While lexical analysis tools can catch it, and coding standards (like putting the constant/literal value on the LHS) will help, it's still an unnecessarily wide trap that catches too many people.

      There is little real benefit to allowing an assignment to be used as a member of an encompassing expression. In fact, that "feature" only promotes overly complex statements that are harder to read and debug. And with optimizing compilers being so good these days, there's no reason not to break a statement into smaller, more readable pieces.

    11. Re:Wow, a paper about GT by fyngyrz · · Score: 1

      Well, if that's a problem for you, write all your code with ":=" and then run it through a text processor prior to compiling. Easy enough.

      Personally, I have not made that error in decades, so it's not something I think about much. But then again, I don't have to deal with other people's code; it's the other way around.

      --
      I've fallen off your lawn, and I can't get up.
    12. Re:Wow, a paper about GT by grimmjeeper · · Score: 1

      I don't believe that you haven't made that error in decades. Well, not if you're still using a C style language. I've been writing code since 1978 and I still make that mistake from time to time. Typos happen. To everyone. It doesn't matter how long you've been in the business.

    13. Re: Wow, a paper about GT by Anonymous Coward · · Score: 1

      You don't need tools, gcc catches these as warnings since a long time.

    14. Re: Wow, a paper about GT by grimmjeeper · · Score: 1

      Those warnings are useless when your code intentionally uses assignments in conditional expressions because you either ignore the warnings or you turn them off.

    15. Re:Wow, a paper about GT by Darinbob · · Score: 2

      Why do those languages that use GT also use "+" instead of PLUS? a lot of times the reasons aren't about having words instead of symbols, but other pragmatic reasons. There were limitations on early punch card formats, the relevant symbols just may not have existed. IBM Model 026 keypunch did not support . And once you've got "EQ" to distinguish from "=" then it's much easier to use "GT" or "LT".

    16. Re:Wow, a paper about GT by Cederic · · Score: 2

      Just because they allow you to do this doesn't make it sensible, good programming or acceptable in any sane code base.

    17. Re:Wow, a paper about GT by guestapoo · · Score: 1

      I don't know why but I spend more time in Slashdot since I created an account. :(

      About the topic, I don't think this much relates with Latin alphabets, but the nature of human signs - it's easier to recognize the distinguished object among common ones.

      Such as, we could easily recognize the red spot among the bunch of green ones. Similar, the symbol > (and others) is clearly different than common Latin alphabets, but not with gt.
      I'm bet that you could recognize > but more difficult with 'gt' in above sentence, when I do not put gt in a single quote.

      Secondly, we more comfort with symbols, that why the road signages tend to use symbols, when the drivers' brain could quickly recognize what is on a signage.
      Also, like the icons, I could easily recognize the 'Magnifying glass' symbol than the 'Z', or 'ZM' abbreviations.

    18. Re:Wow, a paper about GT by Hognoxious · · Score: 1

      It's much more likely that clumsy fingers will type a character one too many times (or one too few) than to type an entirely different character.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    19. Re:Wow, a paper about GT by Anonymous Coward · · Score: 1

      All compilers since the year 2000 now warn, or even error out when using a single = in an expression where the result is expected to be a boolean (if statements).

    20. Re:Wow, a paper about GT by fyngyrz · · Score: 1

      Doesn't matter if you believe it or not. Doesn't change a thing. :)

      I use F10 to enter '=='; it always types '==', so there you have it. Comparison and assignment have never meant the same thing to me.

      And I didn't say I didn't make typos. I just don't make that particular mistake.

      --
      I've fallen off your lawn, and I can't get up.
    21. Re:Wow, a paper about GT by fyngyrz · · Score: 1

      Yep. And that's why F10 types '==' for me. One keystroke, no typo.

      --
      I've fallen off your lawn, and I can't get up.
    22. Re: Wow, a paper about GT by Anonymous Coward · · Score: 0

      Nope, you rewrite the assignments in conditional expressions in such a way that the compiler does not warn about it. The warning actually tells you how to rewrite that expression.

      All compilers have decided to allow you to use the result of an assignment in a conditional by adding parhentesis around it, for example:

      if ((r = foo())) { }

    23. Re:Wow, a paper about GT by grimmjeeper · · Score: 1

      And you've never accidentally edited a double equal to a single in all that time. Sure you haven't.

    24. Re:Wow, a paper about GT by fyngyrz · · Score: 1

      There is little real benefit to allowing an assignment to be used as a member of an encompassing expression.

      You are wrong. You're just not considering code where performance is important.

      --
      I've fallen off your lawn, and I can't get up.
    25. Re:Wow, a paper about GT by grimmjeeper · · Score: 2

      That may have been true 20 years ago but modern optimizing compilers will generate the same output whether you embed your assignment in the conditional or do it separately.

    26. Re: Wow, a paper about GT by grimmjeeper · · Score: 1

      OK Mr. Pedantic. If you want to bury your code in superfluous parenthesis just to make a point, go right ahead.

    27. Re: Wow, a paper about GT by Anonymous Coward · · Score: 0

      They don't, especially in non-optimized debug mode where generated code matches source more closely.

    28. Re:Wow, a paper about GT by rtb61 · · Score: 1

      Personally I would prefer a programming language that adheres as closely as possible to typical English grammar and usage as well as physics and mathematical formulas and usage but that can be compacted down to be less wordy or remain fully descriptive. A programming language that more closely aligns with existing language logic, rather than creating it's own internal logic with only limited binding to existing communications logic. An open programming language designed from the ground up, a fresh start.

      --
      Chaos - everything, everywhere, everywhen
    29. Re:Wow, a paper about GT by hackwrench · · Score: 1

      Not having looked at replies to your statement, it's easier to me to think of := as assignment and == as comparison. Maybe my exposure to Pascal affects this, or who knows what neurological quirks, but it's similar to those who want reverse direction controls that seems to be based on how the neck moves for up-down, but I'm not sure for left-right. People have lots of quirks like that and we'd be better off writing programs that convert between them than forcing everyone to a single standard. Mike McShaffry wrote in Game Coding Complete that Origin, I think had people who wrote converters for different bracing methods.

    30. Re:Wow, a paper about GT by tibit · · Score: 1

      Remember that the more modern a compiler is, the more the code you provide as input is taken for its semantics only. All that the compiler must do is take the meaning of your code and produce output with the same meaning. Compilers are getting cleverer each day at extracting meaning from your code, and using the meaning in isolation, without using the particular way you have implemented that meaning. For example, on the particular embedded platform I'm using, when you write

      typedef struct { uint16_t hi, lo } word;

      word add(uint16_t a, uint16_t b) {
          word r { 0, a+b };
          if (a+b < a) r.hi ++;
          return r;
      }
      ,
      the compiler understands that you meant to check for carry in addition, and will generate the following code for the function (this is complete):
      _add: mov r0, r28 ; r28 contains zero
      mov r1, r16 ; arguments are in r16:r17
      add r1, r17
      add.c r0, r28
      ret ; result is in r0:r1
      .

      Furthermore, if you happen to use this add in a constant expression, it will pre-execute the code for you and emit no code for it at all, only the results. And that's how it's supposed to be.

      --
      A successful API design takes a mixture of software design and pedagogy.
    31. Re:Wow, a paper about GT by Anonymous Coward · · Score: 0

      Some languages don't make such a distinction. They allow you to use things like

      while(ptr = getnext()) ...

      to traverse through a NULL-terminated list.

    32. Re:Wow, a paper about GT by JimFive · · Score: 1

      For consistency, comparison operators should be 1 character !, =, <, >, which can then be combined into pairs for the other comparisons (!=, >=, etc.). Assignment should be explicit such as == or :=
      --
      JimFive

      --
      Please stop using the word theory when you mean hypothesis.
  2. Use APPerators, not operators! by Anonymous Coward · · Score: 0

    Only LUDDITES use LUDDITE operators when writing LUDDITE software! Modern app appers use APPerators when apping modern apps!

    Apps!

    1. Re:Use APPerators, not operators! by Anonymous Coward · · Score: 0

      Put it in the Cloud, using XML, JSON and NoSQL!

  3. Of course! by i.r.id10t · · Score: 2

    Of course a Gin & Tonic is greater than some symbol

    --
    Don't blame me, I voted for Kodos
    1. Re:Of course! by cellocgw · · Score: 3, Funny

      Of course a Gin & Tonic is greater than some symbol

      Yes! Cue the blonde joke: "I'll have a Fifteen." bartender: "What?" blonde 'You never heard of a Seven and Seven?"

      thanks; try the veal.

      --
      https://app.box.com/WitthoftResume Code: https://github.com/cellocgw
    2. Re:Of course! by Anonymous Coward · · Score: 0

      The one left is the implicit cherry on the top.

  4. Typing versus Reading by szczys · · Score: 2

    I think he's right about the mnemonics being easier to type. They're generally on dominant fingers and you use letters constantly (not so much with pipe, ampersand, great and less than). That being said, I do think the capitalization should be saved for constants, and scanning code with your eyes proves the symbology easier to pick out. Symbols are better.

    1. Re:Typing versus Reading by szczys · · Score: 2

      Just submitted this comment, but not that I think about it. If you want these to be easier to type you should set up your IDE to auto-replace the mnemonics. Type GT(space) and it gets replaces with '>'.

    2. Re:Typing versus Reading by Anonymous Coward · · Score: 1

      Mnemonics are for people who are not professionals (after all, mnemonics MEANS "...to aid memory"). Professionals consistently add new symbols to their useful set. It is clear to me that >, =, are a lot more meaningful than any text substitutes in readable code.

      Imagine dispensing with the integral sign, or sum (or for that matter, any of the symbols...often of Greek origin) in mathematics.

      Mnemonics are for amateurs.

    3. Re:Typing versus Reading by phantomfive · · Score: 2

      The way I look at it, typing speed doesn't really matter (for programming). The bottleneck for my typing speed isn't how fast I type, it's how fast I think. In bad cases, it can take a couple weeks to write ten lines of code.

      I had a professor who couldn't touch type, he used hunt and peck. That is obviously suboptimal, but he was able to program fast even with that handicap.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:Typing versus Reading by TWX · · Score: 1

      On the other hand, students and people in-general have gotten > and < confused for a long time. I can understand why too, they look like arrows, and normally we associate the arrow as pointing to the thing that we are attempting to focus on. They also look a bit funnel-like, almost like they're representing how the thing on the open-side is a component of the thing on the pointed-side.

      That's before getting into the use of those characters, along with other bracketing characters, in other uses in software. Depending on the language one could use squiggly-braces, brackets, parentheses, or these characters. Even in languages like C++ and in Bash they're used to direct, taking a thing and inserting it into another thing.

      yay ambiguity.

      --
      Do not look into laser with remaining eye.
    5. Re:Typing versus Reading by Archangel+Michael · · Score: 2

      > and 1 (X is bigger / greater than 1 )

      Almost everyone could figure it out ... in 3rd grade. If you had a teacher that understood math, they can make anything easy to understand. The problem is, most grade school teachers are VERY poor at basic math. And it shows.

      I'm in education, I see this first hand. Teachers who need calculators to do basic math. And we wonder why our kids can't do simple math anymore.

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    6. Re:Typing versus Reading by serviscope_minor · · Score: 1

      I think he's right about the mnemonics being easier to type.

      Mnemonics being easier to type is definitely a VERY good reason that FORTRAN used mnemonics. I mean, you try typing > on a 1966 era kyyboard which doesn't have the > symbol. You will find that doing so is exceptionally difficult.

      Even F77 was limited to +-*/().,'$:= because they couldn't rely on computers having anything else at all.

      --
      SJW n. One who posts facts.
    7. Re:Typing versus Reading by Xolotl · · Score: 4, Insightful

      The comparison operators > and < have been in use for four hundred years and are (or should have been) learned in primary school. They also work in any (human) language, not just in English, and map directly to what is used in mathematics. No one should be confused by them.

    8. Re:Typing versus Reading by Anonymous Coward · · Score: 0

      I mean, you try typing > on a 1966 era kyyboard which doesn't have the > symbol.

      I assume your keyboard has an "e", though, right?

      Fortran may have started earlier than most, but that doesn't make it bad. And it has supported both .gt. and > for a very long time -- longer than some of these other languages have even existed!

    9. Re:Typing versus Reading by pla · · Score: 2

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

      Call me crazy, but I expect a teensy bit more from a graduate of a 4-year university in a math-heavy major, than I do from 4th graders or the general public.

    10. Re:Typing versus Reading by BarbaraHudson · · Score: 1

      Just do an #include with the right header file and you can use mnemonics to your heart's content. Wrote my own before discovering that there was already an existing one.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    11. Re:Typing versus Reading by obsess5 · · Score: 1

      I feel compelled to defend grade-school teachers. I remember reading a small book by Alfred North Whitehead in which he said that mathematicians were notoriously bad at arithmetic (i.e., basic math). (If you aren't familiar with Whitehead, he and Bertrand Russell wrote Principia Mathematica, published beginning in 1910.) Teachers are obviously in good company. And, in my experience back in the 1960s and early 1970s, my grade-school teachers were quite good at their subject fields.

      I'm reminded of a letter to the editor in the Communications of the ACM back in the 1980s when a computer person (who generally had and have remarkable salaries) complained (i) about the salaries teachers were getting paid and (ii) that some math teachers, for example, had the gall to describe functions as lenses. As a former avid photographer, I had come to view functions the same way--on my own, it was not something I had ever heard anyone else say, not even a teacher; i.e, a function focuses values from the domain onto values in the range. It's not an exact analogy, but I still picture it in my head that way.

      (Of interest to photographers perhaps: back in the early 1970s, Popular Photography, I think, sliced a 35mm SLR in half, shone lasers into the multi-element lens, blew cigarette smoke into the SLR to make the lasers visible, and took a photograph of the laser beams being focused on the focal plane. Not exactly on the focal plane because the lens elements had been knocked slightly out of whack in the process of cutting the SLR in half. It was pretty cool!)

    12. Re:Typing versus Reading by skids · · Score: 1

      Mnemonics are for people who want to later have to remember which DSLs decided on "ne" and which ones decided on "neq" and hence lose most of the benefit.

      The only real advantage to them is on the commandline so you don't have to escape shell syntax. Or when you actually make them do something subtly different (but useful) than the symbolic ones, as in Perl.

    13. Re:Typing versus Reading by grimmjeeper · · Score: 2

      That's the reason early C had trigraphs. So that you could get the job done on old mainframes that didn't have all of the symbols used by the language.

    14. Re:Typing versus Reading by Anonymous Coward · · Score: 0

      > and 1 (X is bigger / greater than 1 )

      Almost everyone could figure it out ... in 3rd grade. If you had a teacher that understood math, they can make anything easy to understand. The problem is, most grade school teachers are VERY poor at basic math. And it shows.

      I'm in education, I see this first hand. Teachers who need calculators to do basic math. And we wonder why our kids can't do simple math anymore.

      COMPUTE RESULT IS X GREATER-THAN-OR-EQUAL-TO 1
      STORE RESULT

      I seem to recall a programming language which used a similar syntax...what was it? [ /sarcasm ]

    15. Re:Typing versus Reading by Obfuscant · · Score: 1

      Call me crazy, but I expect a teensy bit more from a graduate of a 4-year university in a math-heavy major, than I do from 4th graders or the general public.

      Ok, you're crazy. I work at a University. I see graduates in math-heavy majors on a regular basis. Expect what you want; live in reality.

    16. 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.

    17. Re:Typing versus Reading by Gr8Apes · · Score: 1

      As far as I'm concerned, you'd use whatever works for the language in question. I generally prefer readability and for me, at least, GT equates to something that could be a variable, whereas '>' is unambiguous. But again, whatever the language calls for.

      --
      The cesspool just got a check and balance.
    18. Re:Typing versus Reading by Hognoxious · · Score: 1

      Teachers who need calculators to do basic math.

      Not sure how that would help. Calculators do arithmetic.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    19. Re:Typing versus Reading by Hognoxious · · Score: 1

      Similar symbols are used in music for going quieter and going louder.

      I don't know when the current system came in, however, and it matters not a jot when you have tin ears.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    20. Re:Typing versus Reading by whit3 · · Score: 1

      Mnemonics being easier to type is definitely a VERY good reason that FORTRAN used mnemonics. I mean, you try typing > on a 1966 era kyyboard which doesn't have the > symbol. You will find that doing so is exceptionally difficult. Even F77 was limited to +-*/().,'$:= because they couldn't rely on computers having anything else at all.

      This is an interesting point: we use language symbols, other than full spelled-out words, for reasons of brevity. Boolean operators (not, and, or, nand, nor, xor, xnor) don't qualify for either a full set of symbolic representations, nor do there exist words that most folk would recognize for them. Numeric comparisons likewise aren't fully covered by conventional (ASCII) symbols.

      The least confusing, most natural computer-language way to include all these, is with library functions x = a .and. b becomes x = and(a, b)

      Alas, it seems everyone is so wedded to the math-formula expression syntax that the only perceived options are inline operators, with all the syntactic confusion that follows from the familiar use of "=" for assignment

    21. Re:Typing versus Reading by Just+Some+Guy · · Score: 1

      Alternatively, they're wide on the side with the bigger number, and narrow on the side with the littler number.

      --
      Dewey, what part of this looks like authorities should be involved?
    22. Re:Typing versus Reading by hackwrench · · Score: 1

      One of the few things I remember about first grade was that the teacher had a stuffed alligator and said that the alligator went after the greater number and the shape of the alligator's mouth was the shape of the greater or lesser than sign.

    23. Re:Typing versus Reading by hackwrench · · Score: 1

      Whoah, I just posted almost the same thing as you because it's too much trouble to read all the previous replies to a post before posting your reply. My teacher was in a Catholic school in the Myrtle Beach, SC area.

    24. Re:Typing versus Reading by mrprogrammerman · · Score: 1

      What's helped me is to realize the lesser than looks like an L.

    25. Re:Typing versus Reading by CCarrot · · Score: 1

      On the other hand, students and people in-general have gotten > and < confused for a long time. I can understand why too, they look like arrows, and normally we associate the arrow as pointing to the thing that we are attempting to focus on. They also look a bit funnel-like, almost like they're representing how the thing on the open-side is a component of the thing on the pointed-side.

      Huh, interesting. I learned that they were Pac-Man skeletons, and of course an undead Pac-Man would eat the biggest meal he could find...

      My primary school math teacher may have been a bit eccentric, but hey, he was memorable :)

      --
      "I love animals! Some are cute, others are tasty, what's not to like?" - Betsy Schroeder, Jeopardy contestant
    26. Re:Typing versus Reading by jwhitener · · Score: 1

      Until you come across a bash line like:

      ps -ef | grep blah > output.txt

      I guess you could say that the alligator ate the 'ps -ef | grep blah' and, uhm..., 'transferred it' to output.txt :)

  5. mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 3, Insightful

    Stick to simple mathematical symbols for the basic comparators we've use since elementary school. Shame about the fucking mess with = and ==.

    1. Re:mnemonic assumes everyone speaks English by Alain+Williams · · Score: 4, Insightful

      I sometimes wonder how many zillions hours of programmer debugging time would have been saved if K&R had used ':=' for assignment (like Pascal) rather than '=' ? The number of times people have assigned rather than compared is huge.

    2. Re:mnemonic assumes everyone speaks English by war4peace · · Score: 1

      TRUTH.
      Also, "GT" could mean a lot of different things to a lot of different people, whereas ">" would mean the same thing to all (madmen aside).
      In my native language, "Greater Than" ("GT") should become "MMD". Ironically, "Lesser Than", in my native language, would also be shortened to "MMD" (because "Greater" and "Lesser" start with the same letter in my language).
      Of course, we could use "MMD" and "MmD" to differentiate, which would work under certain languages but not at all in others. Or stick to the English terms and have to retrain your brain away from the established operators.

      --
      ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
    3. Re:mnemonic assumes everyone speaks English by CrashNBrn · · Score: 1

      That's one of my favorite "quirks" of AutoHotkey -- while it does allow usage of a sole "=", assignment can be done with ':=' and comparison with '=='.

    4. Re:mnemonic assumes everyone speaks English by phantomfive · · Score: 1

      Mnemonics are symbols too. There's no reason to believe that GT is better than > just because we can pronounce it. That is the primary advantage, right? We see it and we automatically know how to pronounce it. It's still a symbol.

      Of course, you can type GT and have it show up on Slashdot without weird codes, so that's something.

      --
      "First they came for the slanderers and i said nothing."
    5. Re:mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 0

      The keyboard they used didnt have the : character.

    6. Re:mnemonic assumes everyone speaks English by Archangel+Michael · · Score: 1

      X > Y "X is bigger than Y" It is an evaluation not an operation. The alligator wants the bigger one.

      The fact that people are confused is because they don't understand what is being asked. "Which one do you want, X amount of chocolate or Y amount of Chocolate? Now, say it to explain it ...." leaving the answer, "I want X because it is bigger/greater than Y"

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    7. Re:mnemonic assumes everyone speaks English by phantomfive · · Score: 1

      I'm pretty sure you had an interesting point in there, but I read your post three times and I'm not really sure what you were saying.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:mnemonic assumes everyone speaks English by BarbaraHudson · · Score: 1

      What the poster meant is that on a semantic level, mnemonics symbolize (stand in for) the symbols. For example, we use the symbol == for a comparison operation. We can also define a mnemonic, gt, for that same operation.

      However, neither one is the actual comparison - they are both mnemonics (or they are both symbols in the broader sense).for a mathematical operation that takes place when the code is invoked.

      A disassembler can convert the binary to individual instructions, such as:
      LD AX 14
      LD BX CX
      CMP AX BX
      JE $address1
      JMP $address2

      Because they are shorthand for load, compare, jump if equal, jmp, they are mnemonics. However, they also symbolize the actual binary bytes that are generated when assembled, so they are also symbols, so the point of the article is just stupid semantic navel-gazing. For languages that do macro expansion and token pasting, ust make a header file for the symbols and you can use the mnemonics, so who cares. And for languages that don't do macro substitution and token pasting, such as Java, write a pre-processor yo do a search and replace on a copy of your source, and give the final output the right extension.

      Finally, a topic with NO SJW stuff. There might be hope for slashdot yet :-)

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    9. Re:mnemonic assumes everyone speaks English by phantomfive · · Score: 1

      Nice post.

      I do think it's worth thinking about which is better, even if the author didn't give very good reasons. It would have been cool if he'd done a study that actually did show one to be preferable (or more likely, which situations each one is preferable).

      --
      "First they came for the slanderers and i said nothing."
    10. Re:mnemonic assumes everyone speaks English by angel'o'sphere · · Score: 1

      Har har har har!
      Actually that deserves one Har more!

      Do you claim copyright or my I copy your one liner for future pasting.

      Rofl, people are turning their heads wondering why I'm laughing so hard.

      Haaar Haar haaar haar, muhhhuha... That was a good one!

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    11. Re:mnemonic assumes everyone speaks English by phantomfive · · Score: 1

      Do you claim copyright or may I copy your one liner for future pasting.,

      I hereby grant you, Angel'o'sphere, full unconditional rights to use it in any way you like.

      --
      "First they came for the slanderers and i said nothing."
    12. Re:mnemonic assumes everyone speaks English by BarbaraHudson · · Score: 1

      People are free to use either one - they both end up generating the same code if you've set things up right :-)

      Or misdefine the mnemonics in a replacement header file for the lulz :-) This way you could distribute your source into something that won't compile properly on another machine ...

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    13. Re:mnemonic assumes everyone speaks English by phantomfive · · Score: 1
      --
      "First they came for the slanderers and i said nothing."
    14. Re:mnemonic assumes everyone speaks English by angel'o'sphere · · Score: 1

      Thank you, it come in handy sometimes!

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    15. Re:mnemonic assumes everyone speaks English by alvinrod · · Score: 2

      It's less of an issue for the newer high level languages that are either strongly typed or don't implicitly treat numbers like a boolean. for example:

      int x = 5;
      if(x = 7)
      {
      foo();
      }

      This gets caught at compile time because x = 7 evaluates to an int which can't be used as a condition by itself.

      The only problem you get is if you have a case where x is a boolean type and you're doing assignment instead of comparison, but you shouldn't need to check (x == true) or (x == false) anyhow as you can just use (x) or (!x) respectively.

      Besides, if we had to use := instead of just =, we'd be complaining about the zillions of hours lost typing that extra keystroke when an '=' would be a perfectly serviceable operator choice because of course we're such good programmers and would never mistake the two for each other.

      Also, is there a way to get white-space in a /. post? It seems as though the non-breaking space is stripped out.

    16. Re:mnemonic assumes everyone speaks English by Actually,+I+do+RTFA · · Score: 1

      if K&R had used ':=' for assignment (like Pascal) rather than '=' ?

      I used to agree with you. Then I saw that R allowed you to use an arrow. Either way. So 5->x or x <- 5 are both valid. Kinda nifty.

      --
      Your ad here. Ask me how!
    17. Re:mnemonic assumes everyone speaks English by KGIII · · Score: 1

      IIRC with PHP, you even get == (equals) and === (identical to). Then != (not equal) and !== (not identical too).

      --
      "So long and thanks for all the fish."
    18. Re:mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 0

      But of course the mnemonics would be localized, right?
      2 SÄ 1

      I think in three languages, so

      2 SÄ 1
      2 SK 1
      2 GT 1

      would all be about equal and appear, I guess with a 40-40-20 % likelihood.

      Real fun begins when we get the off-shored code from that Hindi-speaking guy.

    19. Re:mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 0

      In maths you might say "let a = 1" so = is used for assignment, but then you might also say "when a = 1 then we ...." so for consistency with mathematics using 'let' would make sense, and it has been used. But then for full consistency with maths >=, = and != (or /= in Fortran) would all be single characters, had they been available in the character sets of the period.

    20. Re:mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 0

      I'd prefer spelling it out completely: "beaucoup plus grand".

      Or are we ignoring the huge numbers of non-native English speakers here?

    21. Re:mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 0

      x<(-5) or put 5 into x?

    22. Re:mnemonic assumes everyone speaks English by Actually,+I+do+RTFA · · Score: 1

      Oh, yeah, I suppose that may be a tad confusing. It's put 5 into x, both ways. I didn't think about inequalities and negative numbers.

      I like the ability to assign either way, but that would coerce people into using whitespace in the comparisons.

      --
      Your ad here. Ask me how!
    23. Re:mnemonic assumes everyone speaks English by Anonymous Coward · · Score: 0

      I hate that about Java.

      if (x) and if (!x) are much shorter than if (x != 0) and if (x == 0)

      You need those NULL checks all the time in Java anyway, so why not make them easy on the fingers?

    24. Re:mnemonic assumes everyone speaks English by toddestan · · Score: 1

      How did they do the ternary operator then?

  6. Do anything other than what Perl did by selectspec · · Score: 0

    Languages are best served when there is one way to express a statement, rather than two (or three, or four, etc.) By making expressions consistent, it is easier to learn and read.

    Perl is a classic example of punctuation gone awry, although it is not alone in this regard.

    --

    Someone you trust is one of us.

    1. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 4, Informative

      In Perl, where there are both operators (e.g. gt and >), the textual one (gt) does a string comparison, while the mathematical one (>) does a numeric comparison, fairly consistently.

    2. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      But, why though?

    3. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 2

      ^ This. They are NOT doing the same thing. You are used to operators being overloaded to do very different things depending on context. Now, Perl does awful things with overloading in lots of other places but in this one place I think it gets it right. (I also think having a dedicated string concatenation operator is the way to do, not overloading + for that purpose.)

    4. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      Because lexical ordering is different than numerical ordering.

    5. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      Numeric sort and lexicographic sort are not the same thing. "200" > "1000" but 200 1000. Some languages would overload a string and a number differently to pick which to use and you need to use a function call to use the other one, but in a typeless language that has less clarity than being explicit about which you want to use, especially in a language frequently used to process text files in which case the number frequently won't have been cast to a number.

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

      ^ This

      Not This?

    7. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      Languages are best served when there is one way to express a statement, rather than two (or three, or four, etc.) By making expressions consistent, it is easier to learn and read.

      Ah, then you'll love APL!

    8. Re:Do anything other than what Perl did by GTRacer · · Score: 1

      You made me smile! You win!

      --
      Defending IP by destroying access to it? That makes sense, RIAA/MPAA. Go to the corner until you can play nice!
    9. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      Xor this.

    10. Re:Do anything other than what Perl did by Ukab+the+Great · · Score: 1

      The more complex and TIMTOWDIsh a language is, the more potential work you have to do to create parsers/IDEs for it.

    11. Re:Do anything other than what Perl did by grimmjeeper · · Score: 1

      Because you can't derive from context whether you want to treat the variables as strings or numbers because the comparison method is different. Without explicit variable typing, you have to provide a way for the developer wants to perform the comparison.

    12. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      ^This

      or in C ->This

    13. Re:Do anything other than what Perl did by angel'o'sphere · · Score: 1

      As perl was envisioned as a replacement for shell scripts: not consistent at all.
      In sh/ksh/bash == and != are string comparisons, numeric ones are -eq and -ne etc. ;)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    14. Re:Do anything other than what Perl did by kjhambrick · · Score: 2

      What Perl did was definitely an improvement over /bin/sh where the nmemonic ( ex: -gt ) works on integers while the symbolic ( > ) works on strings ...

    15. Re:Do anything other than what Perl did by CrashNBrn · · Score: 1

      Why do you even need a string concatenating symbol? The lack of a symbol when strings are adjacent would be enough for a compiler|interpreter to determine it should be concatenation - if the language was designed as such.

      FOO:="FOO"
      BAR:="BAR"
      FOO:=FOO BAR "LICIOUS"
      or
      FOO.=BAR . "LICIOUS"
      It irks me everytime I use a language that uses "+" as string concatenation. Plus is Math addition for petes sake.

    16. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      ~ that. this: ~

    17. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 1

      GT and > are different operators in Perl. Your comment is baloney.

      Further the "punctuation" rap that Perl gets is due mostly to the built in regex support that is rather handy.

    18. Re:Do anything other than what Perl did by Anonymous Coward · · Score: 0

      Xor is Not Not.

    19. Re:Do anything other than what Perl did by Daniel_Staal · · Score: 2

      I'd argue that the 'punctuation gone awry' view of Perl is largely because it was one of the first languages to fully embed regular expressions. While it has a fair number of different punctuation operators on it's own, nearly all are shared by other languages, and most of the rest are because the syntax has to differentiate between different types of variable operations, where more statically typed languages can let the types determine that.

      --
      'Sensible' is a curse word.
    20. Re:Do anything other than what Perl did by xupere · · Score: 1

      This.

  7. Are there any non-English languages? by xxxJonBoyxxx · · Score: 4, Insightful

    Are there any non-English languages or anyone using the language for whom English is a challenge? If there are, the use of symbols would seem to be preferred over remembering what the first letters of "plus que" are in English. (FTW.)

    1. Re:Are there any non-English languages? by Anonymous Coward · · Score: 0

      "plus grand que"
      FTFY.

    2. Re: Are there any non-English languages? by aglider · · Score: 1

      No. There isn't any. Why asking?

      --
      Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
    3. Re:Are there any non-English languages? by Anonymous Coward · · Score: 0

      "plus grand que" ... with cheese

    4. Re:Are there any non-English languages? by Anubis+IV · · Score: 1

      I had a similar first thought as well. There's no reason to increase the mental overhead on people who don't have English as a first language. It's one thing to have functions or classes named in English, since there are already so many of those that it's a matter of memorization anyway, regardless of your native tongue, but it's something else entirely to take mathematical symbols that are well understood across a variety of spoken languages and replace them with something that's English-specific.

      Moreover, having been a Teaching Assistant for several different introductory languages, including FORTRAN (which uses mnemonics like ".GT."), C++, and Pascal (both of which use symbols) during my time in grad school, my anecdotal evidence would suggest that even among native English speakers, the symbols are far easier for newcomers to pick up and learn.

    5. Re:Are there any non-English languages? by Anonymous Coward · · Score: 2, Interesting

      A bare minimum of English is needed for programming. If, else, switch, case, import and so on are hard to avoid.

      I would still argue that > is better than GT though. The reason is that reading the meaning from a symbol comes more natural to the brain than reading letters, which is then turned into a sound/word, which then is turned into a meaning. This mean a symbol like > takes less energy for the brain to read and it becomes easier and faster to read the code. Also using letters for variables and symbols for operators is also a way to make it easier to identify what is what.

      if ((varA > varB) && (varC > varD))
      if varA GT varB and varC gt varD

      It's not like readability is precisely the same for those two lines even though they are identical from a mathematical point of view.

      One more thing about reading symbol vs letters. Japan uses both symbols (kanji aka Chinese letters) and phonic (hiragana, which is sounds like in English) and since they are able to write the very same text with both systems, they study the effect of symbols vs sounds in writing. It turns out that symbols are faster to read. Even more interesting is it that they activate different parts of the brain, which mean it is possible to be dyslexic for sounds only, while symbol reading is unaffected. Clearly using symbols vs words is more than just "like to look at GT or >".

    6. Re:Are there any non-English languages? by Xolotl · · Score: 1

      Agreed. The symbols are easier because every child learns them in primary school maths class. The mnemonics are a relic from a time when the character encoding on the IBM 704 didn't have the > and < symbols, there is no rational reason for using them today.

    7. Re:Are there any non-English languages? by GuB-42 · · Score: 1

      Come one, you only need to know maybe a hundred English words and no grammar to understand what mnemonics are about. In fact, non-natives may have a slight advantage because their smaller and more specialized vocabulary may reduce the risks of confusion.
      I am not a native speaker and language was never a problem for understanding mnemonics. If there is a problem, it is in the details : strings or numbers, signed or unsigned, strict or may be equal, precedence rules, ...

    8. Re:Are there any non-English languages? by phantomfive · · Score: 1

      That's like trying to remember whether P or V is the operator to increment a semaphore.......

      --
      "First they came for the slanderers and i said nothing."
    9. Re:Are there any non-English languages? by BarbaraHudson · · Score: 1

      Just make an include file with macros that expand from the mnemonics you would use in your language to the mnemonics in the base language. CMP (comparer) for ==, etc. Problem solved.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    10. Re:Are there any non-English languages? by BarbaraHudson · · Score: 1

      The mnemonics are a "relic" of assembler. Has nothing to do with keyboards missing a symbol or three. GT, LT, EQ, are all assembler mnemonics.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    11. Re:Are there any non-English languages? by cdrudge · · Score: 1

      I would still argue that > is better than GT though. The reason is that reading the meaning from a symbol comes more natural to the brain than reading letters, which is then turned into a sound/word, which then is turned into a meaning. This mean a symbol like > takes less energy for the brain to read and it becomes easier and faster to read the code.

      If that was the case, instead of an if-statement we should have a ? (boolean expression) statement. Instead of push/pop or enqueue/dequeue we should have +(object and -(object). There should be no keywords and they should only be keysymbols because "meaning from a symbome comes more natural to the brain..."

    12. Re:Are there any non-English languages? by Anonymous Coward · · Score: 0

      I prefer the use of the mnemonics, for sure. For some reason I can fairly easily read >, but often causes me to pause and think about it. With mnemonics there is no pause.

      Are the mnemonics English oriented? Of course! Yet most computer languages have an English orientation in their core syntax. I doubt that substituting symbols for arithmetic mnemonics is suddenly going to make non-English programmers feel right at home.

    13. Re:Are there any non-English languages? by Anonymous Coward · · Score: 1

      I would still argue that > is better than GT though. The reason is that reading the meaning from a symbol comes more natural to the brain than reading letters, which is then turned into a sound/word, which then is turned into a meaning. This mean a symbol like > takes less energy for the brain to read and it becomes easier and faster to read the code.

      If that was the case, instead of an if-statement we should have a ? (boolean expression) statement. Instead of push/pop or enqueue/dequeue we should have +(object and -(object). There should be no keywords and they should only be keysymbols because "meaning from a symbome comes more natural to the brain..."

      That's not the same. The comparison operators are already commonly known by anybody who knows a bit of math (and who writes code without knowing even basic math?). Math lacks symbols for push and pull, which mean whatever symbols somebody comes up with for programming will not encounter the same "I know that one", in which case it will not help code reading the same way. We don't debate if the code should use + or plus. Math already told us to use + and everybody knows what it does.

      It's also worth noticing that the math symbols are used for operators. If only operators use symbols, the symbol will tell two things at once, both the meaning and "this is an operator". If all keywords gets a symbol, you can't identify operators this way anymore.

      There is also a practical issue with symbols for keywords in general. It wouldn't take long before you run out of decent keywords when using standard ASCII. Sure you could start using non-ASCII, but then your code starts to be prone to encoding issues. Utf-8 should solve this, but not everybody use it. Japan was mentioned and that is actually one of the major issues regarding utf-8 usage. They tend to stick to shift-jis where all characters use 2 bytes. In utf-8, all characters native to Japan use 3 bytes. While I woudn't care much for size of plain text anymore, they seem to do enough to reject utf-8. Also it would appear that shift-jis has some interesting features when using shift-jis, that utf-8 lacks, like character classifications with very simple code and using utf-8 would require a rewrite of the code into something more complex. This mean if you add a non-ASCII symbol to a programming language, you should expect that nobody in Japan can use it and it's not limited to just Japan. As a result, I can't imagine any programming language using non-ASCII will be popular worldwide.

    14. Re:Are there any non-English languages? by Xolotl · · Score: 1

      I didn't say "keyboards" I said character encoding. The IBM 704 (on which Fortran was developed) had a 6-bit character set which did not include > or <, for the same reason Fortran did not use square brackets [ ]. Similarly, the 704's word size limit accounts for (original) Fortran's 6-character identifiers.

      IBM 704 assembly language didn't have GT, LT or EQ. It had things like CAS (Compare Accumulator with Storage) which worked in one direction only.

    15. Re:Are there any non-English languages? by Godwin+O'Hitler · · Score: 1

      "supérieur à"
      FYFI

      --
      No, your children are not the special ones. Nor are your pets.
    16. Re:Are there any non-English languages? by BarbaraHudson · · Score: 1

      I think you missed the point - all assemblers use mnemonics, just different sets. (this IS a discussion of mnemonics vs symbols after all)

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
  8. COBOL code... by Passman · · Score: 1

    I tend to use "GREAT THAN", "LESS THAN" and "EQUAL TO", but only if I have enough space on the line.

    --
    Minne-snow-da: Winter is comming...
    1. Re:COBOL code... by Vlad_the_Inhaler · · Score: 1

      why? COBOL has accepted > = since at least the early 70's.
      COBOL got something else right as well, "=" is totally unambiguous - it takes MOVE FIELD1 TO FIELD2 to assign something.

      --
      Mielipiteet omiani - Opinions personal, facts suspect.
    2. Re:COBOL code... by Anonymous Coward · · Score: 0

      > why? COBOL has accepted > = since at least the early 70's.
      > COBOL got something else right as well, "=" is totally unambiguous - it takes MOVE FIELD1 TO FIELD2 to assign something.

      You obviously haven't looked at COBOL since the 70s.

            COMPUTE field2 = field1 (or mathematical expression)

      However, it is still unambiguous. COMPUTE is an assignment statement. '=' as an evaluation is only found in a conditional statement. ie you cannot have an evaluation in a mathematical expression.

  9. Someone with too much time on his hands... by QuietLagoon · · Score: 1

    Really? This guy wasted time and electrons on this?

    1. Re:Someone with too much time on his hands... by Anonymous Coward · · Score: 0

      Good news, the electrons were all recycled from all those CRT's we got rid of in the 90's and 00's.

      Unfortunately, those precious lost moments of you life are long gone.

    2. Re:Someone with too much time on his hands... by Anonymous Coward · · Score: 0

      Good news! The electrons all formed in the past hot dense phase of universe.

      Or alternatively, good news! Particle count is observer-dependent in relativistic quantum field theory (the electron field formed via spontaneous symmetry breaking in the past hot dense phase of the unverse, and particles are just excitations in the field). If you see fewer electrons, it's not because he wasted them, but rather because you are moving slower than most observers.

  10. SAS is shit as shit by Anonymous Coward · · Score: 0

    This post marks the new low mark of sharkjumping for /.. Good for the /advertisement for the expensively bloated carcass that is SAS.

  11. Re:Gamer here by Anonymous Coward · · Score: 0

    But really though, fuck you.

  12. Knowledge of English by ledow · · Score: 4, Insightful

    ">" is universally understood in mathematics
    "GT" relies on a knowledge of English, and what it stands for, and thus what it means.

    But the bigger question - WHY does any language created nowadays have hard-coded operator names? If you prefer >, why not just use that and make it equivalent to GT in whatever default settings you provide? Why are you constrained to the choice of operators given to you and the mnemonics they choose to use?

    However, arguing over it is pointless. Change if it you can, otherwise it doesn't matter. If you can change it, or overload it, or rename it, or macro-ise it as you like, than it doesn't matter either.

    1. Re:Knowledge of English by cfalcon · · Score: 3, Insightful

      Because code review

    2. Re:Knowledge of English by countach · · Score: 4, Insightful

      I don't know if the world needs even more unreadable code where people are overriding the basic operator names.

    3. Re:Knowledge of English by Anonymous Coward · · Score: 0

      ">" is universally understood in mathematics

      It was quite stupid to reuse the symbol for an HTML tag in mathematics if you ask me. Because of that decision, HTML parsers have to be mindful of "<" within <script>.

    4. Re:Knowledge of English by Anonymous Coward · · Score: 0

      Is it a troll? Mathematics use of these symbols predates HTML by centuries.
      The choice of so called angle brackets for delimiter in HTML (and templates in C++) was the worst delimiter choice ever.

    5. Re:Knowledge of English by ledow · · Score: 1

      HTML parsers have to be mindful anyway. That's why scripts end with and nothing else (i.e. it's SUPPOSED to ignore any HTML tags within the script as well, in case the SCRIPT wants put push out HTML tags!).

      Your crappy parser is not an excuse.

    6. Re:Knowledge of English by ledow · · Score: 1

      Fucking Slashdot - was your crappy parser written by one of the Slashdot crowd? There's supposed to be a close script tag in there.

    7. Re:Knowledge of English by Anonymous Coward · · Score: 0

      Because the code needs to be used and understood by others. And for security it has to do what it is obvious it does rather than having that subverted by some compiler setting.

    8. Re:Knowledge of English by JesseMcDonald · · Score: 1

      People override the basic operator names because they can't define their own. Languages which allow arbitrary sequences of symbols as operator names generally don't have the same problems with operator overloading that you get in e.g. C++. Of course, they generally also require operator names to be unique within the current scope, just like function names. If overloading is permitted at all, it's restricted to implementing a common interface which defines the type and semantics of the operator.

      With proper language constraints, code which uses custom operators is no harder to read than code which uses custom function names. The operators are just functions named by symbols rather than alphanumerics.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
    9. Re:Knowledge of English by Anonymous Coward · · Score: 0

      ">" is universally understood in mathematics

      Not only that, but the symbol ">" is logical in its graphical design. The "big" end is near the bigger expression, and the "small" end is near the smaller expression -- suggesting an almost physical difference in the look of the big and small sides in comparison to each other.

      Once someone sees that, it's (1) easy to remember, (2) language-independent, and (3) obvious what "<" means also.

      "GT" and "LT" are lexical, so I suspect that they might require an extra mental step to convert them to their meaning, which might slow down their recognition somewhat. I would not be surprised if psychological testing showed that experienced FORTRAN programmers can react correctly a few milliseconds faster when they see "a > b" versus when they see "a GT b".

    10. Re:Knowledge of English by Anonymous Coward · · Score: 0

      ACtaully I work with code that have hardcoded operators but they all begin with * so it is *GT for greater than. varibles with a &. A-Z 0-9 $#@_ are allowable chars in a name. simple and stragith forward. To make it look moden they have add > = ^= where *not is easier to read.

      The issue is the hype-rloading of of symbols:
      > less than
      >> pointer to
      = equate / set
      == equal to
      --> pointer again
      =- equate and decreament

      really?? who is the idoit that thought that was good. Andd don't even talk about bash!!

    11. Re:Knowledge of English by holophrastic · · Score: 1

      You can't just change operators, some ways of changing them would break the parser. For example: "if 5 > 6" might be normal, you can't change it to "if 5 0 6", you can't map "if" to "38" either.

      But you can always do whatever you want to do, in your own pre-compile stage. Write code however you like, then write a converter to convert your syntax to the other one. If you can parse your own syntax, that's all that matters.

      Also, > and GT are not the same in good languages. In perl, for example, the former is mathematical, the latter is linguistic. That means more than just a differing precedence too. It's a type-casting difference, it's also a readability difference. Am I reading math or logic, logic or instruction, programmatic algorithm or business application logic?

      The difference is particularly functional with languages that recognize ">" as non-legible, and "GT" as letters. "gt" can be a case-insensitive match, whereas "GT" can be case-sensitive. > could interpret strings containing numbers (e.g. "File 123") as logically padded so File123 would come after File21, whereas gt would to the opposite.

      Welcome to linguistic development. Anything can be done in at least a dozen ways. Some believe that makes the choice meaningless. Quite the opposite. It means that the choice you make says something about your code, and that enhances readability.

    12. Re:Knowledge of English by chrism238 · · Score: 1

      > If you can change it, or overload it, or rename it, or macro-ise it as you like, than it doesn't matter either.
      But please make sure that when you change it, that you change it in a portable way, so that I don't need any extra software/front-ends just to compile your software.

    13. Re:Knowledge of English by complete+loony · · Score: 1

      That only works if your code is not stored as text. If your IDE parsed the code, and re-rendered it with your preferences, this might be bearable. Otherwise there's no way to work together as a team.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    14. Re:Knowledge of English by Anonymous Coward · · Score: 0

      In Swift you can define your own operators as a sequence of mathematical (+ some others) unicode symbols.

      Very handy when you create vector and matrix classes and actually define the cross product and dot product operators. Or when creating an interval arithmatic class you can define more comparison operators and set operators.

    15. Re:Knowledge of English by Anonymous Coward · · Score: 0

      Do what now?

      Sorry, this is a write-only coding shop

  13. Yeah? by fustakrakich · · Score: 1

    And how do you play >A?

    --
    “He’s not deformed, he’s just drunk!”
    1. Re:Yeah? by Anonymous Coward · · Score: 0

      Joystick. Turns out, it's a lot like Ms. Pac-Man.

    2. Re:Yeah? by Anonymous Coward · · Score: 0

      Doesn't Ms. Pac-Man use a clit-mouse?

    3. Re:Yeah? by Anonymous Coward · · Score: 0

      That's what your Mom asked me.

  14. Re:Gamer here by pablo.cl · · Score: 1

    What about Lesser Turismo?

  15. Ignored after the first sentence by OverlordQ · · Score: 4, Interesting

    They unfortunately used perl as an example. While yes Perl does have both gt and > one is a string comparison and the other is a numerical comparison.

    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:Ignored after the first sentence by Tablizer · · Score: 2

      Dynamically typed languages should somehow allow explicit type comparing. Perl has the right idea, but it's too easy to forget to use the right one, especially if you work with other languages.

      I'm starting to lean toward functions like str_gt(), num_gt(), etc. (or str_greaterthan();).

      Another option is something like: "str_cmp(a, '>', b)" and "num_cmp(a, '>', b)". I often make my own utility functions for such because the built in ones don't fit my needs. For example, I often compare strings first by trimming and then ignoring case. Rarely do I need to do case-sensitive comparison.

      One downside of rolling your own comparison functions is loss of efficiency, but app CPU is rarely the bottleneck in most apps I deal with.

    2. Re:Ignored after the first sentence by truckaxle · · Score: 3, Informative

      Perl has the right idea, but it's too easy to forget to use the right one, especially if you work with other languages.

      Actually it is quite easy to remember Perl's usage... The operator 'gt' uses strings and is used for a string comparison. The ">" is a math symbol and used for numeric comparison.

    3. Re:Ignored after the first sentence by Tablizer · · Score: 1

      That's true, but it's only half the problem. The other half is when one switches between different languages, they tend to leak those habits cross-language. Thus, one may end up using ">" in Perl even if they intended a string compare.

    4. Re:Ignored after the first sentence by Anonymous Coward · · Score: 0

      Perl has a reputation as being a language that's difficult to read. This is, of course, opinion, but it's still an opinion that it seems like more people have about perl than many other languages. That is, it's true that perl is difficult to read for quite a few people, no matter how you look at it.

      For the record, this post isn't about perl, I'm still just thinking of mnemonic vs symbolic--I'm just not sure perl is the perfect example of where to use each, assuming the debate is about which is more universally legible.

      As an aside, while gt vs > in perl seems easy to remember out of context, remember that it's also an inconsistent way of representing those operators with respect to strings and the other mathematical operators, even internally w/in perl itself. "Plus", for example, isn't 'p' or 'ps' or "plus' (mnemonic) when used with strings, it's '.' (symbolic - a period).

      If you draw a matix operators on one axis, and numbers, strings on the other axis, and entered in the values of "symbolic" or "mnemonic" in each cell, to a non-perl programmer, you'd get a semi-random pattern that's not quite as easy to remember as you might think, especially when you start adding in other languages, and trying to remember them all.

      The language that either consistently uses one or the other is easier to remember in a lineup of languages ("that language is more symbolic", "that language lets you use both" vs "in this language, here's the matrix: ").

  16. Logical Operator by jklovanc · · Score: 1

    To me it a logical operation is part of an equation and symbols make much more sense than abbreviations. Mixing symbols and mnemonics just confuses things.

  17. = gt = & = lt = by TechyImmigrant · · Score: 1

    The problem with is it could be a forwards arrow or 'greater than or equal to'

    It means different things amongst the languages most people use most of the time.

    Overloaded terms suck. Let's not do that.

    --
    I should use this sig to advertise my book ISBN-13 : 978-1501515132.
    1. Re:= gt = & = lt = by TechyImmigrant · · Score: 1

      That post got mangled beyond recognition by the slashdots. Please insert right and left angle brackets where it makes sense.

      --
      I should use this sig to advertise my book ISBN-13 : 978-1501515132.
  18. I never learned APL by Anonymous Coward · · Score: 0

    I never learned APL, but I do prefer > over GT

    1. Re:I never learned APL by jfdavis668 · · Score: 1

      Be very glad you never had to learn APL

    2. Re:I never learned APL by Anonymous Coward · · Score: 0
      APL has a variety of symbols... and it is recommended practice to use a particular dictionary of words to 'read' them. You need the mnemonic words to discuss (without writing), but also usually think in those mnemonic terms. The old joke is

      Then I realized that I had spelled '-' wrong. - John Whitmore learns APL

      which derives from the fact that APL defines two symbols 'negative' and 'minus'. These symbols look similar but they don't do the same thing...

  19. You use the symbolic by cfalcon · · Score: 1

    You use the symbolic. They are concise, they help with the processing in the meat brain (if writing words was better for humans parsing formula, then mathematicians would never have resorted to formula), and they don't need to be translated when going to a language where Greater Than doesn't abbreviate to GT.

  20. The problem is using operators for other things by david.emery · · Score: 1

    It's one thing to use ">" for "less than". It's a whole nuther thing to use it for things like bit shift ">>" or dereference "->" And then there's the various uses of "+" and worst of all "=" vs "==".

    I'm firmly convinced someone will write a paper on "C Syntax Considered Harmful," and symbol misuse is one aspect of C that causes bugs.

    1. Re:The problem is using operators for other things by Anonymous Coward · · Score: 0

      i don't understand this complaint. >> is clearly different from >, and
      really, if you don't know what > means, you have no business programming,
      and you're just as likely to not know what "greater than" really means.

    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:The problem is using operators for other things by StatFiend · · Score: 1

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

      Um, I think this must be a typo, (">" is usually "greater than"), because I would be *extremely* upset if a language actually used ">" for "less than"!

    4. Re:The problem is using operators for other things by Anonymous Coward · · Score: 0

      Not at all.

      "A > B" is clearly pronounced "B less than A". Whats the matter, hung up on reading left-to-right?

    5. Re:The problem is using operators for other things by Anonymous Coward · · Score: 0

      ... and worst of all "=" vs "==".

      = vs == vs .equals()

      or

      = vs == vs ===

    6. Re:The problem is using operators for other things by Anonymous Coward · · Score: 0

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

      Um, I think this must be a typo, (">" is usually "greater than"), because I would be *extremely* upset if a language actually used ">" for "less than"!

      There are good reasons to do that. For example, imagine I have a class that always stores negative integers. I have a built in type of unsigned int in my language that would work perfectly to use internally to store my data except that are completely backwards! So I can just redefine them for my class to work the other way.

    7. Re:The problem is using operators for other things by avandesande · · Score: 1

      Hah! You should get a kick out of this then...

      http://unicodelookup.com/#grea...

      --
      love is just extroverted narcissism
    8. Re:The problem is using operators for other things by BarbaraHudson · · Score: 1

      No, but my compiler tends to be :-)

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    9. Re:The problem is using operators for other things by Anonymous Coward · · Score: 0

      I don't know what's worse: that there's a "neither less-than nor greater-than" code point, or that there's also a separate "neither greater-than nor less-than" code point.

    10. Re:The problem is using operators for other things by david.emery · · Score: 1

      Mea culpa! :-)

    11. Re:The problem is using operators for other things by radarskiy · · Score: 1

      All of these words keep using the same letters over and over again.

    12. Re:The problem is using operators for other things by Anonymous Coward · · Score: 0

      Last month I implemented an interval arithmatic class which stores the lower and upper limit of a value. The limit width is increased as errors in the calculation accumulates.

      One requirement is that floating point rounding directions is downward to -inf for the lower limit calculations and upward +inf for upper limit calculations (it is more complicated than that). This requires you to change the mode of the FPU/SSE a lot of times. The trick is to store the upper limit as a negative number and always round downward to -inf.

      Using this trick maps many operations to simple SSE instructions, where the SSE register can store a complete interval as two doubles.

      Quite confusing to implement, but that is why we have unit tests.

  21. H1Bs by Anonymous Coward · · Score: 0

    It is ironic that theodp spends all of his time complaining about H1B's, yet people waste time on stuff like this. If you actually did meaningful work, maybe the H1B's wouldn't be taking your jerb.

  22. Either math or real language by angel'o'sphere · · Score: 1

    Mnemonics like GT or LT make no sense unless you program in assembly.
    If you can enhance languages like C++ to accept them, then use 'greater' etc.

    I'm working on my own language, too. Close to programming languages but easy to read and easy to type on tablets. Sure, I could craft a full IDE and habe a custom keyboard.

    However the constraints that are the reason that some languages use -eq or .eq. as comparission operators are long gone.

    What I don't get e.g. why people insist to use def for both variables and functions ... other languages use func, var, val, let.

    Sorry: all that makes teaching languages just complicated. Why is it so hard to either use a mnemonic that indeed tells what it is: const instead of val in Scala or let in Swift or just write it out? On top of that I'm still a fan of the Pascal way. Just have a label introducing a section ... the C# and Java way where you have to write "(static) (final) public Type var" for every line of code just causes me eye cancer.

    I basically only switched to Groovy and a bit of Scala (and disabled syntax colouring) to type less (and read less!) and be not slain by a wall of what looks like random colours to me. I for fuck sake know that a final variable can not be assigned to, and why for fuck sake is anybody expecting that I'm so dumb that I overwrite such a variable, and if I would who cares, the compiler would flag it: so why must it be displayed in an eye cancer causing colour? On top of that: I would never memorize those colours ... a waste of brain power.

    So if you plan for new languages, make them please less C/Java/C# like, we have to many of those already.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    1. Re:Either math or real language by OrangeTide · · Score: 1

      What I don't get e.g. why people insist to use def for both variables and functions ... other languages use func, var, val, let.

      Because in some languages a function is just another type of data that you can process, modify or create with other functions. It's when you call it, not when you define it, where the rubber meets the road.

      --
      “Common sense is not so common.” — Voltaire
    2. Re:Either math or real language by angel'o'sphere · · Score: 1

      Exactly, and a 'definition' is already a higher level concept.
      For beginners it is much easier to grasp that the are 'making' a variable with the var keyword and are 'making' a function with the 'fun' keyword.
      Calling is a different matter, some languages actually use the call keyword for that ;)

      And please: can you tell us laymen the difference between a 'declaration' and a 'definition'? While you are about the nitpicking right now?

      My point simply is: there is no need anymore to have esoteric language concepts hiding behind esoteric syntax.

      With a good IDE you are cranking out code insanely fast, so there is no need for 'fancy' short coded syntax either.

      A language like python with type interference and getting rid of the need to declare a parameter for self (and the need to use it when you call methods if the same class) would imho make programming much mor easy to learn.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Either math or real language by OrangeTide · · Score: 1

      I depends on the language's architecture. 'var' and 'fun' might do exactly the same thing or they might be fundamentally different. I like languages where 'fun' is just syntax sugar for 'var'.

      call, eval, () and numerous other mechanism exist in the wide universe of computer languages.

      My own language is somewhat weird in that a function is an array of objects (procedure really), and declared the same way. applying an array of objects applies every one of them recursively, which will push them on the stack or recurse into them (call them). A quote object is used to contain an object as data that can't be called and won't be recursed. A kind of braindead hack related to a more elegant mechanism found in Lisp. The point of a quick overview of my own language which nobody else is likely to ever use is that there are so many viable programming languages out that that it's hard to make broad assumptions about how they should work or what conventions are correct for users of the language.

      --
      “Common sense is not so common.” — Voltaire
    4. Re:Either math or real language by spauldo · · Score: 1

      What I don't get e.g. why people insist to use def for both variables and functions ... other languages use func, var, val, let.

      Some LISPs do this, for very good reason.

      In LISP, symbols are a data type by themselves. Some LISPs, like Common LISP and elisp, use different "special forms" to declare functions and variables and assign them to symbols (defvar vs. defun, for instance). Others, including Scheme, use the same special form for both (define).

      In either case, you can treat functions as data. Passing a function is done the same way as passing a variable. A function can be manipulated just like data. This is because LISP code is written and stored in the "standard" LISP data structure - your code is data.

      Very few languages support this concept, mostly for performance and security reasons, and because it tends to break your brain. It's very powerful once you get the hang of it, though.

      I highly recommend watching MIT's "Structure and Interpretation of Computer Languages." It's not a Scheme course per se, but it's a very good introduction to working with first class functions. One of the instructors was the co-inventor of Scheme.

      --
      Those who can't do, teach. Those who can't teach either, do tech support.
    5. Re:Either math or real language by angel'o'sphere · · Score: 1

      I'm unfortunately a LISP-hater ;D

      But your comment is certainly informative for others, I hope you get some mods on it.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  23. Reasonable mixture by aaaaaaargh! · · Score: 1

    A reasonable mixture of both conventions should be used, and it's a bad idea to have synonyms for primitive operations. Readability is more important than being able to type code fast.

    A good language defines a minimal set of primitive operations and allows the user to define the rest, including infix, postfix, and prefix operators, so it's not clear to me what the problem is.

  24. I think by Anonymous Coward · · Score: 0

    GT can be greater than >, after all how much less than can > be LT ?

  25. The topic was resolved at... by harshath.jr · · Score: 1

    "Functionally, the operators are equivalent, so which ones you use is largely a matter of personal preference"

    1. Re:The topic was resolved at... by Anonymous Coward · · Score: 0

      And the input device. A paralyzed programmer with an eye controlled input device might, or might not, prefer one over the other if there are, or are not, any mathematical symbols in the input system.

  26. It's all about vocabularies by aglider · · Score: 1

    That's it!

    --
    Sent as ripples into the electromagnetic field. No single photon has been harmed in the process.
  27. Depends upon context ... by MacTO · · Score: 1

    When the symbols are in common use and are being used in the conventional sense (such as >), then go with the symbol.

    Examples:
    C: a > b, common use and used by convention. Should be used.
    LISP: (> a b), common use but not common convention. Probably should not have been used.
    ASM: J>, not common use nor common convention. Thankfully it wasn't.

    It should also be noted that mnemonics aren't an ideal solution either. Mnemonics relies upon the reader understanding the context since any given mnemonic may have several meanings. While useful in print, people also have a nasty tendency to say the mnemonic as the mnmonic while talking (that is to say GT as gee-tee rather than as greater than). This obscures the meaning, which should be frowned upon.

  28. Better as symbols for add and subtract by transfire · · Score: 1

    On a related note I've wondered if > and < and + and -, are really the best symbols for their use. Clearly addition as "adding to", and subtraction is "taking away", os the natural symbols for those would be arrows. 5 <- 4 is 9 and 5 -> 4 is 1. Hence > and < seem like better symbols for addition and subtraction.

    1. Re:Better as symbols for add and subtract by Dog-Cow · · Score: 2

      A symbology that requires one to read in a different direction based on the symbol would be extremely retarded and infinitely stupid.

    2. Re:Better as symbols for add and subtract by schini · · Score: 1

      Yes! Time to start a political movement to get this fixed! It's all the same up to isomorphisms anyhoo.

    3. Re:Better as symbols for add and subtract by angel'o'sphere · · Score: 1

      For my mind both examples either equate to 9 ( first one, you add 4 to 5, second one you add 5 to 4 ) or it is simply bollocks, as an arrow for me either indicates a direction or an assignment, so left side says the 5 becomes 4 and right side means the 4 becomes 5, could have been easier written as -- and ++ ;)
      Anyway, regarding + and - ... you simply learn those symbols in school. Obviously a kid could have memorized left arrow as + instead.
      However using arrows in a new programming language ... likely no chance to win supporters, unless it is a new variation of Prolog that uses left arrow instead of :- for clause definitions.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  29. It's all squiggles by OrangeTide · · Score: 3, Interesting

    It's all squiggles on the screen that I have to learn to interpret in the correct context.

    --
    “Common sense is not so common.” — Voltaire
    1. Re:It's all squiggles by azcoyote · · Score: 2

      It's all squiggles on the screen that I have to learn to interpret in the correct context.

      This is true. All letters are symbols, and all symbols require a context in order to interpret. Somebody above pointed out that > is universally understood in mathematics, and thus its universality seems to make it preferable to GT, which is based on English. But this can be misleading. In the long run, > is just as arbitrary as GT, and although the symbol is widely used in mathematics, that is no guarantee that it will retain a clear meaning forever. A context will always be necessary, and although mathematics provides a kind of easily-accessible and widely-dispersed context, the specific system of mathematics that we utilize today is still a culturally-developed system of symbolization, and hence it is neither truly universal nor immortal.

      At the same time, even the mathematical context may not adequately guarantee that the meaning of > is understood. In fact, it is questionable whether the strictly mathematical meaning of > is strictly at play in computer programming. The Perl gt operator already shows that the sphere of the meaning of "greater than" within programming can be wider than that which belongs to ordinary mathematics. In other words, the symbol > is borrowed from the context of mathematics, but this originary context is not the only context that determines the usage of this symbol within programming. It is always possible for this symbol to carry additional meanings not strictly intended by mathematical logic.

      The strength of C++, for example, is that you can define your own operators and how they operate upon particular data structures, such that > can mean anything you want it to mean. Of course it would be silly to use > to mean "less than," but one might use it to mean "greater than" in a way that is only analogous to the scalar numerical calculation; hence for example one could conceive of a "greater than" with regard to GPS coordinates that does not measure which coordinates are greater in sheer magnitude, but rather determines which are farther north.

      In short, no symbol is guaranteed in its meaning by an external relationship to another, distinct usage of the same symbol. It does not matter whether the symbol comes from written or spoken language, academic usage or common dialect, science or superstition; all symbols are determined in their meaning by context.

      --
      Incipiamus, fratres, servire Domino Deo, quia hucusque vix vel parum in nullo profecimus.
    2. Re:It's all squiggles by Anonymous Coward · · Score: 0

      I assume western mathematics is nearly universally understood in the modern world. At least on this planet and in this time.

      ML is much more flexible in defining operators than C++. I fine C++'s operator overloading to be quite limited in comparison.

    3. Re:It's all squiggles by petermgreen · · Score: 2

      The strength of C++, for example, is that you can define your own operators and how they operate upon particular data structures

      IMO the weakness of C++ is that you can define how the provided operators work on custom types but you can't create new ones.

      The result is that the set of provided operators gets overloaded to have very different meanings.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    4. Re:It's all squiggles by Anonymous Coward · · Score: 0

      This guy gets it, they are both symbolic
      "GT or >?"
      One represents a relationship between two things and the other one represents two sound in a specific language which are implied to mean two words which when put together gets a meaning which could be interpreted to mean the same thing as the first symbol.

      Which is best? The logical symbol which could be interpreted with the use of logic and no previous knowledge of a specific language, application or even culture. Or is it the second which requires you to know two illogical symbols, understand the concept of acronyms, have knowledge of the English language and the application in which they are used. You be the judge.

  30. A vote for symbols... by Richard+Kirk · · Score: 1

    I started off programming in Algol in the sixties. I have used symbols and abbreviations.

    Abbreviations can give you clashes with variable names. You normally learn what to avoid, but it is easy to have integers i, j, k, and floats if, jf, and kf, and not notice what you have.

    That being said, it is a shame we don't have the right symbols on your keyboards. I would like... - Separate single symbols for assignment (:=) equality (==) and perhaps identity, or deep equality - The set cup and cap symbols for logical operations and tests (how many people evaluate CATS and DOGS as CATS and/or DOGS when they write. - A separate decimal and period.

    Instead we have all sorts of weird junk, such as the '' symbol on the top right, which only appears in the correct spelling of Lord Xenu's full name. Or something.

    Heigh-ho, ain't gonna happen. But we can dream.

    1. Re:A vote for symbols... by Anonymous Coward · · Score: 0

      Sounds like you want an APL keyboard...

    2. Re:A vote for symbols... by JesseMcDonald · · Score: 1

      That being said, it is a shame we don't have the right symbols on your keyboards.

      If you're using a Unix system, the programmable Compose key can be very useful. I generally map it to the Menu key and have a stripped-down custom .XCompose file with mnemonic bindings for the most common Unicode mathematical operators, Greek letters, currency symbols, and accented characters.

      Of course, to use it you also need a programming language which allows custom operators with Unicode symbol characters. I recommend Haskell.

      --
      "The state is that great fiction by which everyone tries to live at the expense of everyone else." - Bastiat
  31. leave it the frick alone by raymorris · · Score: 1

    Most languages have used roughly the same operators for at least 40 years. Generations of programmers know > is greater-than. Leave it alone.

    1. Re:leave it the frick alone by Anonymous Coward · · Score: 0

      It's pathetic that the IDEs can't automatically convert from one to the other based on parsing the code the way the compiler would.

      Symbolic operators should absolutely be the standard, especially since they are both more obvious and accepted in math and science. The argument that mnemonics are easier to type is ridiculous. Again, it's sad that the IDE can't simply have the mnemonics as context sensitive shortcuts.

      Part of the problem is the fact that code is kept exclusively in plain text. There should be optional layers of linked markup files that would allow editing and metadata at different levels.

  32. Fortran's use of GT by PRMan · · Score: 1

    Back when Fortran came out, keyboards weren't standardized yet. Also, some systems used variations of 7-bit or even non-ASCII encodings like EBCDIC. The > symbol wasn't guaranteed to be present on a given keyboard or even in the codepage. Using GT was out of necessity, no other reason, because letters were guaranteed to be on every keyboard and in every codepage.

    Later languages (such as C and BASIC) were criticized for their lack of portability, but eventually because of them, ASCII became a standard.

    --
    Peter predicted that you would "deliberately forget" creation 2000 years ago...
    1. Re:Fortran's use of GT by Anonymous Coward · · Score: 0

      Close.

      Back when Fortran came out, it was all keypunches. The older IBM model 026 keypunch (primarily intended for data entry) lacked a lot of characters (like >) that didn't appear until the IBM 029. This is also why older program listings were ALL CAPS, because the keypunches had no easy way to code lower case. (It was technically possible but would have involved double-punching the same column, a real pain in the ass.) Yes, I worked as a keypunch operator (entering tax return data during tax season before college. I'm about the only person I know who knows what a drum card is, let alone how to program one (although I've probably forgotten that). Now get off my lawn.)

    2. Re:Fortran's use of GT by Arnold+Reinhold · · Score: 1

      Back when Fortran came out, keyboards weren't standardized yet. Also, some systems used variations of 7-bit or even non-ASCII encodings like EBCDIC. ...

      Uhh, not quite. Back when Fortran was introduced in 1957 and when comparison operators were introduced in Fortran IV in 1962, pretty much everyone was entering programs on punched cards, mostly using the IBM 026 keypunch machine which did not have the greater than and less than symbols. In fact a special 026 "scientific character set" was required to show parentheses or equal sign on the keyboard or to print them on the cards. While each computer model tended to have its own internal character code, the punched card code itself was well standardized, even among IBM's competitors. The EBCDIC character set, which does have greater than and less than symbols, was introduced with the IBM System/360 in the mid-1960s, along with the IBM 129 keypunch, but the less expensive (and indestructible) 026 continued to be used by programmers for many years thereafter, especially at academic institutions. There is a good picture of the 026 keyboard on Wikipedia: File:IBM 026 keyboard.mw.jpg

    3. Re:Fortran's use of GT by angel'o'sphere · · Score: 1

      Actually C also has 'mnemonic' for keys that are hard to type on old keyboards.
      But I never used them, so don't remember them, does someone have a link?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    4. Re:Fortran's use of GT by BarbaraHudson · · Score: 1

      Had nothing to do with FORTRAN and keyboards. Assembler languages predate FORTRAN, and the assembler mnemonics for some of the op codes were carried over.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    5. Re:Fortran's use of GT by Anonymous Coward · · Score: 0

      > Also, some systems used variations of 7-bit or even non-ASCII encodings like EBCDIC.

      Some used 6-bit encodings. Some printers had 48 character sets (chains or barrels). Some systems used BCD (the 'E' in EBCDIC is 'Extended').

      > but eventually because of them, ASCII became a standard.

      ASCII is _American_ Standard Code for the Information Interchange, broken by 'code pages'.

    6. Re:Fortran's use of GT by Anonymous Coward · · Score: 0

      The 026 didn't have parentheses either; we had to multipunch them.

    7. Re:Fortran's use of GT by Arnold+Reinhold · · Score: 1

      The 026 didn't have parentheses either; we had to multipunch them.

      That's not the whole story. Prior to EBCDIC, the convention was to use % and lozenge in the commercial 026 character set to represent left and right parentheses and # to represent equals. IBM offered 026 keypunches with those characters replaced on the keyboard and print matrix and compilers understood them as "(", ")" and "=". It was called the scientific character set option. When EBCDIC was introduced, the commercial card codings were retained and new card codes introduced for "(", ")", "=" and many others. But compilers I worked with all recognized the older codings, at least until I stopped using keypunches in the mid 1970s. But if you had a need to enter a proper EBCDIC "(", ")" or "=" on an 026 you would have had to multi-punch, as you say. Was there some software you used that did not recognize the "scientific" 026 encodings?

    8. Re:Fortran's use of GT by istartedi · · Score: 1

      C has iso646.h and trigraphs and maybe digraphs to work around this issue. Strangely, gt doesn't appear to be in there, perhaps because and there is no trigraph for < either unless I'm missing something. Maybe those characters are mor universal than I thought, and others less so. I've never been in an environment where I had to use these things; but it's something to be aware of...

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  33. Interesting question for science oriented langs by halfdan+the+black · · Score: 1

    I'm actually designing a new language, syntactically based on python but adds rule based programming and many operators for tensor calculus and constructive solid geometry.

    My question is how do people feel about typing non-ASCII characters.

    For example, the union of two spatial domains, should it be "c = union(a, b)" or "c = a \{insert big U symbol here\} b", or how about lambdas, or better yet, circle plus for tensor operations.

    I realize most people here probably don't do much involving many mathematical operations, but what do you guys think about non-ascii characters in programming languages. What I'm thinking about is having an operator system such that you could type in the statement "c = union (a, b)" in a plain text editor, but the operators would be define such that they would include some sort of pretty print or symbolic form, so that when viewed in a special editor, they could be viewed as full unicode glyphs.

    1. Re:Interesting question for science oriented langs by Anonymous Coward · · Score: 0

      I think you've just answered the question with your post. You weren't able to show a program listing with non-ASCII characters.

    2. Re:Interesting question for science oriented langs by TeknoHog · · Score: 1

      Julia is a pretty scientific language with a simple syntax based on Fortran and Python. It has things like union(A, B) for sets. Non-ascii keywords sound like a terrible idea. I expect you know LaTeX and understand why it uses ascii, even though the end results are pretty symbols.

      --
      Escher was the first MC and Giger invented the HR department.
    3. Re:Interesting question for science oriented langs by jouassou · · Score: 1

      Alternatively, you could also consider using multi-letter infix operators, such as c = a b in your union example. This would have the benefit of being easy to type since it's only ASCII characters, but at the same time easy to pretty-print by just converting all instances of to a unicode U+222A symbol using e.g. a regular expression. While this would make your language more original, it would likely be more user-friendly towards people used to other languages if you stuck to a function-like syntax c=union(a,b) though. This would also eliminate the problem figuring out operator precedence in large expressions.

    4. Re:Interesting question for science oriented langs by petermgreen · · Score: 1

      For example, the union of two spatial domains, should it be "c = union(a, b)" or "c = a \{insert big U symbol here\} b",

      There is really two seperate but related questions here

      1: ascii VS unicode. Unicode looks nicer for equations but is less portable and is harder to enter. There is also the problem that programmers like to use fixed with fonts which gets more complicated with unicode.
      2: function style VS operator style. IMO operator style makes complex formulas much easier to read than function style but it's useful for a programmer to be able to tell the difference at a glance between variable/function names and operators.

      One option could be to allow use of either unicode or ascii representations for operators. For example you could establish a convention that extended operators expressed in ascii started and ended with a dollar sign (or some other character, I picked the dollar sign because it doesn't seem to be used for anything in python). So the union operator could be written as either $u$ or as the unicode character for union. The circle plus operator could be written as either a unicode circled plus character or as $+$ and so on.

      You could then provide a tool to convert between the pure ascii representation and the unicode representtion.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    5. Re:Interesting question for science oriented langs by halfdan+the+black · · Score: 1

      That's basically exactly what I was thinking, that's how mathematica does it.

      I'm not keen on the dollar signs, but I could easily have the syntax do thing like c = a :union: b or c = a :U: b. I like the words spelled out as its much easier to read.

      And then, there could either be a tool that goes back and forth between text and unicode, or a special editor could display the unicode chars after you type the character sequence.

  34. Re:mnemonic assumes everyone speaks English+ by Ungrounded+Lightning · · Score: 2

    Shame about the fucking mess with = and ==.

    When I did a "desk language" (a notation for writing code on paper notes, which might have had a compiler written for it later), about the time C was being developed (but before I had access to it), one of the things I did was carefully avoid items like that. One thing I did was ban the bare equal sign.

    ":=" Replacement (also: like C, unary ops had before and after replacement forms - by adding : the same way C adds =, i.e. ":+" and "+:"
    "==" Equality
    "===" Equivalence (Two variables are aliases for the same storage. Think "union" but as a separate "put these two things in the same storage / use this symbol (perhaps as a different type) for the same bits as that one" declaration.)

    I also had the logical and bitwise operators swapped from the way C did it - because "||", "&&", etc. are mnemonic for a string of bits. (This proved to be the biggest stumbling block when I started coding in C.)

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  35. symbolic. by Anonymous Coward · · Score: 0

    gt ge lt le eq ne or xor and mul div add sub
    That's fine. But what's the mnemonic for a bitwise or?

    1. Re:symbolic. by BarbaraHudson · · Score: 1

      Capitalize - AND, OR, XOR ... for bitwise ops.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
  36. Wow by Anonymous Coward · · Score: 0

    What a waste of time.

  37. Re: Gamer here by Anonymous Coward · · Score: 0

    You mean Forza, right?

  38. Agreed. Except the shell, editor by raymorris · · Score: 2

    > In bad cases, it can take a couple weeks to write ten lines of code

    Absolutely agreed. And my ten (or 100) lines do the same task that someone else's 3,500 lines did, and do it more elegantly, because I'm using meta-programming.

    On the other hand, at the shell, it's helpful if the typing is fast enough that it doesn't effect my train of thought, which can be fast for tasks I know. You mentioned hunt and peck. That ends up being think, stop, hunt, peck, stop, think, stop, hunt, peck, think, stop - breaking one's train of thought. There's a qualitative difference when you're just thinking and the typing takes place automatically, in another mental "thread".

    1. Re:Agreed. Except the shell, editor by phantomfive · · Score: 1

      My main point was that gt and > is probably not going to make much difference either way when it comes to programming speed.

      --
      "First they came for the slanderers and i said nothing."
  39. Not even correct. by whoever57 · · Score: 4, Informative

    He includes Perl as a language that has both symbolic and mnemonic operators, and says that functionally they are equivalent, but this isn't really correct. In Perl, for example, "==" is not the same as "eq": one is a numeric comparison, the other is a string comparison and for consistent results the correct operator must be used.

    --
    The real "Libtards" are the Libertarians!
    1. Re:Not even correct. by fyngyrz · · Score: 1, Insightful

      That's one of the reasons I find Perl to be an undesirable language to use.

      --
      I've fallen off your lawn, and I can't get up.
    2. Re:Not even correct. by Anonymous Coward · · Score: 0

      That's one of the reasons I find Perl to be an undesirable language to use.

      How old are you? Under 30? Bugger off! Perl is a fine language if you are competent and do not resort to notational short-cuts to appear clever / 1337. I have developed systems comprised of thousands of lines of Perl and written in such as way as to be maintainable by a competent programmer regardless of their language background.

    3. Re:Not even correct. by fyngyrz · · Score: 1

      I am 59. I've been writing software since the 1970's. I have written well over a million lines of Perl that I am still responsible for. I stopped using it for new work in favor of other languages quite some time ago, and when my existing Perl codebase needs significant new functionality, I call out to Python from within Perl. I am not the least interested in going back to writing anything of note in Perl, nor does your interest in Perl in any way translate into an interest in Perl for me.

      You, of course, are entitled to your own opinion. No matter what it is.

      --
      I've fallen off your lawn, and I can't get up.
    4. Re:Not even correct. by azcoyote · · Score: 4, Informative

      I can understand why one might dislike this distinction between string and numeric operators in Perl, but I personally like it a lot.

      Perl is an odd hybrid. On the one hand, it for the most part does not distinguish between different scalar data types syntactically (no strict declarations as in C++). This makes it a more casual language that is good for quick scripting within a limited environment (similar to JavaScript), but of course it could lead to confusion later on if a programmer reassigns variables to different data types on the fly. On the other hand, Perl solves potential confusions by using distinct operators for string and numeric operations. This means that (A) it is clear what is being done at any given point, and (B) it simplifies converting between numeric and string data types for on-the-fly operations. This is why Perl is amazing: you can do so much in a single, miniscule line of code, and yet everything you do is very clear and straight-forward in the syntax, however brief it is. Perl is thus capable to some extent of emulating one's flow of consciousness rather than requiring a strict, logical process according to clearly-defined data types. After all, my brain only seems to distinguish between string and numeric data types when I operate upon them (e.g. when I think about the number 2, I can freely flow between adding 3 to it and writing the number out as a word).

      --
      Incipiamus, fratres, servire Domino Deo, quia hucusque vix vel parum in nullo profecimus.
    5. Re:Not even correct. by Darinbob · · Score: 1

      Those who can, do it. Those who can't, write articles about how to do it.

    6. Re:Not even correct. by Cederic · · Score: 3, Informative

      So you've averaged writing over a hundred lines of perl every day since Larry Wall first shared it?

      There's clearly something wrong with the language and/or you, but I'll be polite and avoid suggesting which.

    7. Re:Not even correct. by guestapoo · · Score: 2

      I'm not Perl expert, but I find more comfortable with Perl in text processing than others equivalent language. IMHO, it's faster and more flexible than Python.
      But sometimes, I need to re-read some of my Perl scripts to know how they work again.

    8. Re:Not even correct. by hackwrench · · Score: 1

      You, of course, are entitled to your own opinion. No matter what it is.

      You make that sound like a bad thing.

    9. Re:Not even correct. by Anonymous Coward · · Score: 0

      If your "flow of consciousness" maps to Perl then I suggest visiting a psychiatrist.

    10. Re:Not even correct. by fyngyrz · · Score: 1

      I've averaged far more than a hundred lines a day, I guarantee you that, pal. :)

      --
      I've fallen off your lawn, and I can't get up.
    11. Re:Not even correct. by fyngyrz · · Score: 1

      Only when it's wrong, you see. Doesn't mean you still aren't entitled to it.

      --
      I've fallen off your lawn, and I can't get up.
  40. COBOL ueber alles!!! by Anonymous Coward · · Score: 0

    Certainly the statement:

    add a to b giving c

    is vastly superior to the statement:

    c = a + b;

    How could anyone have thought otherwise?!?

    Next on the todo list -- the quadratic equation ... COBOL style ;)

    1. Re:COBOL ueber alles!!! by c10 · · Score: 1

      Compute C = A + B is closer, but not as funny.

  41. Operator overloading by wiredog · · Score: 1

    I've seen that sort of operator overloading. For some reason it made sense at the time, though I can't remember why.

  42. And then there's COBOL by Anonymous Coward · · Score: 0

    COBOL doesn't have GT, but it does have GREATER. Is that sufficiently symbolic?

  43. Slow news day or something? by mark-t · · Score: 1

    [nt]

  44. Re:Gamer here by jfdavis668 · · Score: 2

    I did too, but I was thinking the car, not the video game.

  45. Mnemonic. by Anonymous Coward · · Score: 0

    "GT" is in fact a mnemonic for "we don't fucking have the fucking > symbol on the fucking IBM 026".

  46. What this is: by kuzb · · Score: 1

    This is weapons grade stupid. This ranks up there with "let's talk about the best editor". People who write articles like this aren't actually attempting to make a point we should care about. They're talking for the sake of hearing themselves talk.

    --
    BeauHD. Worst editor since kdawson.
  47. iso646 by dargaud · · Score: 1

    In C I've been a fan of iso646(.h) ever since its proposal: it replaces ||, && and other boolean operators by 'or', 'and' and more readable things like xor.

    --
    Non-Linux Penguins ?
    1. Re:iso646 by Jamu · · Score: 1

      Replacing ! with not hugely the improves readability of code.

      --
      Who ordered that?
  48. Is it really a waste of time? by fyngyrz · · Score: 1

    A computer language, at least so far, is a means for a human to write something in a structured manner that can be turned, eventually, into sequences of instruction execution that do what the human intended.

    Clarity -- particularly for the newcomer to a language, but also for creation, debugging and maintainance purposes by those who are relatively expert -- trumps conciseness up to a point. This, I think, is why languages with syntax of similar densities to APL are not popular.

    We could say ">", "GT" or "gt", or perhaps even "greater than." 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. It would be useful, I think, to be able to run source code through a translator that made it concise for expert use, and explicit and English-like for the newcomer.

    My outlook on this matter has always led me to write in a less visually compact, airy form, and to avoid (or reformat) coding style based on K&R bracing, which I consider obfuscatory. Writing code in a manner that uses the formatting of the code to cue the action of the code is my intent; that fits in very well with the idea of having the ability to expand or collapse code at various levels of terseness. Thinking about it now, it strikes me to on a par with the ability to collapse and expand a function to and from its declaration in a source code editing tool.

    I write in a number of languages, so the syntax I'm working with changes a lot. When a language uses "&" differently than "and", for instance, I often become disoriented. It think it would be useful to me to have the code expandable to "binary and", "logical and" or whatever the particular distinction is.

    My argument isn't so much for conciseness over wordiness, but more for clarity. For some experts, clarity may be a concise representation. For others, it may not. Perhaps in designing computer languages, we should consider accommodating more types of expertise than that which is found in the APL programmer.

    --
    I've fallen off your lawn, and I can't get up.
    1. Re:Is it really a waste of time? by Hadlock · · Score: 1

      Powershell uses -gt for Greater Than, -lt for Less Than and -eq for Equals
       
      -gt and -lt are fine, however -eq instead of = has caused me no small amount of grief. Powershell still uses = for variable assignment but doing a literal compare requires -eq and often times is not obvious that = is causing the problem where -eq is the required operator.

      --
      moox. for a new generation.
    2. Re:Is it really a waste of time? by Anonymous Coward · · Score: 0

      as does bash. and has done forever.
      http://tldp.org/LDP/abs/html/comparison-ops.html

      Good to see Windows is finally catching up to 1989.

    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:Is it really a waste of time? by unrtst · · Score: 1

      gt and -lt are fine, however -eq instead of = has caused me no small amount of grief. Powershell still uses = for variable assignment but doing a literal compare requires -eq and often times is not obvious that = is causing the problem where -eq is the required operator.

      as does bash. and has done forever.

      Eh, bash uses both "=" and "-eq" as comparison operators. The first is string based, the latter is numeric.

      While I'm sure the following will incite some riots, I personally prefer Perl's handling in this case. For example:
          if ($var = getval()) { # if the assignment resulting from getval() is true ...
          if ($var == getval()) { # numeric comparison of $var and the return of getval() ...
          if ($var eq getval()) { # string comparison of $var and return of getval()

      The first form is, admittedly, and easy place for bugs to creep in, but I still like it, especially when combined with lexical declaration:
          while (my $line = getline()) {

    5. Re:Is it really a waste of time? by pauljlucas · · Score: 2

      It's the same reason && is better than "AND" in C syntax derivatives.

      Given that C has shorthands like ++, I've always wondered why K&R chose && for logical-and and & for bitwise-and. If it were the other way around, you'd save having to write the second & most of the time since one tends to write far more logical-and expressions than bitwise-and expressions.

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    6. Re:Is it really a waste of time? by nmb3000 · · Score: 1

      Given that C has shorthands like ++, I've always wondered why K&R chose && for logical-and and & for bitwise-and. If it were the other way around, you'd save having to write the second & most of the time since one tends to write far more logical-and expressions than bitwise-and expressions.

      I was curious about that too a while back so I looked into it. Turns out that C uses & and | for bitwise operations because its predecessor B did. Why did B use & and |? Because it was derived from BCPL which used words such as and and or for bitwise, and logand and logor for logical. When creating B K&R seem to have decided to directly convert those words to their symbols, & and |. B originally had no logical operators other than not (!) with False and True being 0 and !0, which was also carried into C (later versions of B coerced the bitwise operators into a logical operation if a truth value was expected).

      So why does C use && and || for logical operators? Because & and | were already taken, and from a historical standpoint && actually does save typing, since && is shorter than logand :)

      --
      "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
      /)
    7. Re:Is it really a waste of time? by RyoShin · · Score: 1

      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.

      Oh, how I wish I hadn't run out of mod points, as this is 100% my view.

      When I am trying to read code (whether familiarizing myself with another's code, reviewing code I wrote long ago, or trying to pin down a bug) the use of punctuation like > and < makes it far easier for me to split out statements and work the logic in my head. With "friendlier" syntax I have to first identify what is an operator (especially if someone uses a variable name like "g" or "lot") then mentally parse outward from there.

      I also prefer it for brevity. Consider C#.NET: Boolean statements can be short-circuited using &&, or you can make sure both sides evaluate with &. In VB.NET, the equivalent keywords are ANDALSO and AND. In either case the C#.NET operator is far more concise, and also feeds back into head parsing.

      And, responding to the GP, if someone wants to make an "English" friendly language, fine... but what if someone from Germany, knowing no English, wants to use the language? The OR is no more familiar to them than the |, so I would expect them to prefer the punctuation for brevity.

    8. Re:Is it really a waste of time? by BetterThanCaesar · · Score: 1

      When creating B K&R seem to [...]

      Nitpick: B was created by Ken Thompson and Dennis Ritchie, and then further developed by Stephen C. Johnson. Brian Kernighan was not particularly involved in its creation, although he wrote a tutorial on it.

      --
      "Stop failing the Turing test!" -- Dilbert
    9. Re:Is it really a waste of time? by nmb3000 · · Score: 1

      Doh, you're correct of course. I though "Ken" which turned into K and then into K&R (muscle memory fail). Thanks.

      --
      "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
      /)
  49. It's always been a balancing act... by Anonymous Coward · · Score: 0

    Just as an example, I personally prefer mnemonic (as in Pascal's begin ... end or more precisely Ada's if ... end if) to C/C++/Java's symbolic {... }, particularly when the block markers are optional. Don't get me started on Python's indentation blocks; while I like the notion of required indentation it adds its own little problems for readability/writability.

    As for relations operators, I have no real preference of symbols or mnemonics except that the language should clearly delineate symbolic operators. We are all quite aware of the curse that is C-style operators (= vs. ==, & vs. &&, | vs. ||, etc.) when they are combined with the C-style "anything can go anywhere" mentality. Ask yourself how many egregious security bugs have their roots in things like an accidental = instead of ==.

    Just remember, there are only so many reasonable symbols available for a programming language. Mathematical operations are some of the more consistent symbols used across programming languages (as they are inherited from mathematics) and are also some of the most well understood. That is until you start looking at some of the lesser used ones like ** for power (FORTRAN) or was that ^ -- no that's a pointer (Pascal) -- or was that -> -- or was that &-* notation ... and the list goes on and on.

  50. simple solution by dindinx · · Score: 0

    #define gt >

    --
    DindinX
  51. Personally, ... by PPH · · Score: 1

    ... I welcome our operator overloads.

    --
    Have gnu, will travel.
  52. Re:Gamer here by TheCarp · · Score: 1

    Nobody who has written shell script where > is already -gt as far as the test command is concerned.

    Ever since I started doing a lot of shell, "greater than" has become gt in my head. When i type > I think "gt", unless I am using "less" where its actually a command, and then I am thinking "end"

    So really, I am unsurprised by this question, but at the same time > never stopped being "gt" or "greater than", its a symbol for that. When I see $ I think "dollar" as well, but one does not mean it more than the other, they are the same thing.

    --
    "I opened my eyes, and everything went dark again"
  53. Consistency is important... by Kojow777 · · Score: 1

    I tend to use mnemonic operators (such as GT) for every second operation and symbolic operators (such as >) for every other operator. ...wait, I think I got that backwards.

  54. xkxd has covered issues like this... by Anonymous Coward · · Score: 0

    https://xkcd.com/927/

  55. Depends. by Anonymous Coward · · Score: 0

    Depends. I was a supporter of all-symbolic languages, but I changed my mind. Languages like Python, were *logical* operators (and, or, not) are spelled in English, while mathematical expressions are in symbolic form, are the easiest to read.

    Overusing english words, or overusing symbols, is equally bad.

  56. This is a solved problem... by gweihir · · Score: 1

    Writing code: It does not matter at all. Reading code, symbols are hugely superior as they provide visual separation. And none of this is research-worthy, as it is obvious. There is a reason mathematics has been using symbols for a long, long time.

    That said, symbol sets available on a computer are limited dues to input limitations (PC Keyboards). So logical operators will often be written out. That is inferior to symbols, but as they are full words, it is less of a problem. Human beings are great at recognizing full words. (No, "gt" does not qualify as a full word.)

    Incidentally, it also depends on what people are used to. For example, when I use set operators in code, I use that LaTeX names.That works reasonably well.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  57. It's not a matter of preference by jdavidb · · Score: 3, Informative

    relatively recent scripting languages like Perl ... Functionally, the operators are equivalent, so which ones you use is largely a matter of personal preference

    That is not the case in Perl at all! In Perl, operators like gt and lt are for string comparisons, and operators like are for numeric comparisons. Since in Perl you can conveniently transmute numbers intro strings and vice versa, which operator you use can make a whole lot of difference!

  58. Nothing better to do? by Anonymous Coward · · Score: 0

    Damn, some people are lucky to have jobs where they can ponder such trivia.

  59. 5 different ways by excursive · · Score: 1

    SAS has at least five different ways to express "not equals" in the data step, one of which ("") means something completely different in a different part of the software (SQL). So the case for using NE is pretty good.

  60. Don't stop there by Anonymous Coward · · Score: 0

    Why not replacing all mathematical operators?
    if( 5 gt 3 plus 8 times 2 )

  61. Idiotic by Anonymous Coward · · Score: 0

    Twice as many characters and only makes sense to English speakers. The > and symbols are universal and unambiguous. What the fuck provlem is this meant to solve? How about GTOET for greater-than-or-equal-to? P for plus?

  62. Mnemonics are worse by Anonymous Coward · · Score: 0

    Mnemonics are worse. The reason is that they are less consistent. Everyone can tell what > means, but there are just too many ways to represent 'greater than' mnemonically (even if you assume English is the only language that matters). Doing so is also inconsistent with the other mathematical operators. I don't know about you, but I'd hate to see code like this:

    if bgn bgn 5 pls 9 end div 3 end eqls val then doMyCode()

    to represent something like

    if ((5 + 9) / 3 == val {do my code()}

    Excessive use of acronyms is also not that great of a practice. They are lossy by definition and therefore can mean more than one thing.

  63. Assignment vs equality by Dan+East · · Score: 1

    The problem isn't the assignment operator =. The problem is the equality operator ==. Everyone should know that <> is the inequality operator from BASIC. Thus for equality they should have used !<>. Makes perfect sense to me.

    --
    Better known as 318230.
  64. Sets and operators by infernalC · · Score: 1

    The state of set operators is terrible. In a lot of languages, you have to do crap like MyHaystack.Contains(MyNeedle). SQL has set operators, but not much better. I have always hated SQL predicates of this sort:


    SELECT *
    FROM ORDERS
    WHERE Orders.OrderNumber >= 6 AND Orders.OrderNumber < 56;

    It's just so much to type. Wouldn't it be much nicer if we could just use the set operators we learned in algebra?


    SELECT *
    FROM Orders
    WHERE OrderNumber [6,56);

    -- Argh! Slashdot... there should be an "element of" operator (epsilon) there after OrderNumber...
    -- but alas, you have filtered out the &isin; entity.

    See here for what should really display above.

    I do most of my SQL in the Watcom dialect (SAP SQL Anywhere) . You can do:


    SELECT *
    FROM Orders
    WHERE OrderNumber BETWEEN 5 AND 10;

    which is nice... but I like the idea of being able to express (shortly) both open and closed intervals.

    You can also say:


    SELECT *
    FROM Orders
    WHERE OrderNumber IN (5,10);

    but that means in the set {5,10}, not the open interval (5,10), which I find to be confusing.

    Part of the issue is that the set operators (e.g. epsilon) are not on 101-key standard US keyboards and are hard to type. The other issue is that the set and interval delimiters (, ), {, }, [, and ] have been misappropriated as code block delimiters. My first commercial-grade high-level language was PASCAL, and I thought BEGIN and END were just fine (they persist in Transact and Watcom SQL today). I also like Python's group-by-indent approach.

    1. Re:Sets and operators by Anonymous Coward · · Score: 0

      I think the BETWEEN operator is part of the SQL standard at least when I started at the Polytechnic in 1993.

      However I like the Python way of the interval comparison operator.

      a_fits_in_interval = 5 = a 10

      You can simply define the close and open by using the correct comparison operators.

  65. No need to choose! by dskoll · · Score: 1

    You can have both! We should all change our computer languages to use this: &gt;

  66. Domain by mwvdlee · · Score: 1

    Math uses ">" instead of "GT" and when we use that operator, we're doing math.
    End of discussion.

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  67. Forbidden by Anne+Thwacks · · Score: 1
    It is absolutely forbidden to use symbolic operators on hardware that does not support them.

    I suspect some people do not remember using 5 hole paper tape or CDC punched card code.

    --
    Sent from my ASR33 using ASCII
  68. I didn't know < and > had names by Sheldon_Cooper_1 · · Score: 1

    Back in kindergarten or first grade, my class did a worksheet on < and >. Each problem was a pair of numbers with a circle between them. We were to put either < or > in the circle. After we completed the assignment, the teacher had us correct our own papers; she would call out "less than" or "greater than" for each problem. I was baffled. I had no idea what she was talking about. Even though I answered every problem correctly, it hadn't occurred to me that these two symbols had names.

  69. Re:I didn't know had names by Sheldon_Cooper_1 · · Score: 1

    And even if I had know the names of the symbols, I didn't see a reason that the expressions should be read from left to right. I just put the big end of the symbol near the bigger number and the small end of the symbol near the smaller number.

  70. Re:I didn't know had names by infernalC · · Score: 1

    This begs the question: are they really different operators, or are you just writing the same operator in a different orientation? The fact that we type them differently is perhaps an artifact of the way we encode text on computers. We don't represent characters as a codepoint+rotation duple; instead, we can only record different characters, with a different glyph for every orientation.

    "=" is the only relational operator which is commutative. a = b implies b = a.
    = (Slashdot filters out the single glyph representation of this operator, U+2264) is not commutative. a = b does not imply (or preclude) b = a.

    Is there a name for the property of "" which is that a b implies !(b a)? You could call that operator "anti-commutative", perhaps?

  71. Re:mnemonic assumes everyone speaks English+ by Anonymous Coward · · Score: 0

    For completeness sake := is a blocking assignment. Meaning that the next instruction is not executed until the assignment is completed.

    You also want a non-blocking assignment. The actual assignment is delayed (and may be overridden in following non-blocking assignments). Instructions following a non-blocking assignment will be executed before the assignment is executed and thus work as if the variable has not been modified. The actual assignment will execute at the next iteration.

    Non-blocking assignments are used in ladder logic, or RTL (register transfer level) languages where electronics is designed in (FPGAs and such). Potentially non-blocking assignments could be used in streaming logic like GPU programming.

    Anyway languages like VHDL and Verilog use := for blocking assignments and = for non-blocking assignments. I find = a bit distasteful as it is the same as less than.

  72. Mnemonic plus operator overloading? by Anonymous Coward · · Score: 0

    Seriously, why choose? Build the operators in mnemonic form, add semi-decent operator overloading/defining, and then overload/define the symbolic to represent the mnemonic. Something like:

    bool ge(int a, int b) { blah blah probably inline assembly code or built-in function }
    bool operator>=(int a,int b) { return ge(a,b); }

    (or just let operator>= be callable as a function or via the overloaded operator. Rather like C++ for user-defined operator overloading, but unlike C++ make it applicable to even simple types so you can explicitly write operator>=(a,b) for integers a and b (last I tried C++ doesn't let you do this, assume it's still true for C++11 or whatever we're up to))

    Actually in my dream language that's how *all* symbolic operators would come about, not just the logical ones. Start with a language that is as simple and symbol-free as possible (you'd probably need things like scope operators at base level I guess), properly design a mechanism for defining/overloading operators into the language, then start defining your symbols on top of the underlying language. Let the programmer pick and choose what's appropriate for their code/style.

  73. Re:mnemonic assumes everyone speaks English+ by Obfuscant · · Score: 1

    "==" Equality "===" Equivalence

    So you would have moved the confusion up one character. Instead of a confusion between "=" and "==", you'd have it between "==" and "===".

  74. Blocking and non-blocking substitutions. by Ungrounded+Lightning · · Score: 2

    For completeness sake := is a blocking assignment. Meaning that the next instruction is not executed until the assignment is completed.

    You also want a non-blocking assignment. The actual assignment is delayed (and may be overridden in following non-blocking assignments).

    Had that: "=:", as with "+:" vs. ":+", etc. Like C's equal-sign-concatinated-with-unary-op semantics, the side the colon is on tells you whether the store occurs before or after the whatever.

    Equal sign in my language COULD have been considered a unary do-nothing/"make a local copy" operator (i.e. "foo", "= foo", "= = foo" etc. are all the same thing - except that all but the first might not be acceptable as the target of an assignment, or might result in the store being discarded) - except that, as a special case, a single equal sign was explicitly forbidden to stand alone in an expression.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Blocking and non-blocking substitutions. by Ungrounded+Lightning · · Score: 1

      Equal sign in my language COULD have been considered a unary do-nothing/"make a local copy" operator (i.e. "foo", "= foo", "= = foo" etc. are all the same thing - except that all but the first might not be acceptable as the target of an assignment, or might result in the store being discarded) - except that, as a special case, a single equal sign was explicitly forbidden to stand alone in an expression.

      Correction:

      Equal sign in my language COULD have been considered a unary do-nothing/"make a local copy" operator (i.e. "foo", "= foo", "= = foo" etc. are all the same thing) and stop there. If thinking that way, "= foo" IS "foo". Otherwise ":=" and "=:" wouldn't store anything. B-)

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  75. Correcting the correction. B-b by Ungrounded+Lightning · · Score: 1

    Arg! Edit failure: (Previewed it too and missed it anyhow.)

    Correction:

    Equal sign in my language COULD have been considered a unary do-nothing reference-to-the-thing operator (i.e. "foo", "= foo", "= = foo" etc. are all the same thing) and stop there. If thinking that way, "= foo" IS "foo". Otherwise ":=" and "=:" wouldn't store anything. B-)

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  76. The trend is reversing in REST APIs by mykro76 · · Score: 1

    Mnemonic operators are coming back in REST and other URL-based APIs. For example in OData v4: http://docs.oasis-open.org/oda...

  77. Bash Thinks They're Different by ebcdicpb · · Score: 1

    ==, !=, are used for string comparison inBash.

    In fact you can use '=' for string comparison in Bash according to POSIX. For this reason I think bash would be a great first scripting language >;)

    -eq, -ne, -lt, and -gt are used for integer comparison in bash.

  78. Of course, C/C++ also have mnemonic operators... by Anonymous Coward · · Score: 0

    ... they just don't exist for all operators. https://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B

    Logical and/or exist, etc.

  79. Re:mnemonic assumes everyone speaks English+ by Ungrounded+Lightning · · Score: 1

    "==" Equality "===" Equivalence

    So you would have moved the confusion up one character. Instead of a confusion between "=" and "==", you'd have it between "==" and "===".

    I didn't expect that to be an issue.

    Equivalnce is rare and stand-alone, unlike equality comparison, so triple equal would rarely be emitted and, when it was, it would be in a storage declaration, where double-equal would be a syntax error - as triple equal would be in an expression. It would normally only be emitted as a typo, rather than a brain-o, and the compiler would typically catch it.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  80. vim can do aliases. That's my code editor by raymorris · · Score: 1

    I use vim for editing code. I set defined some aliases so I type (or typo) what I want and vim generates the proper code.

  81. Re:mnemonic assumes everyone speaks English+ by Obfuscant · · Score: 1

    I didn't expect that to be an issue.

    I expect that the person who came up with "==" for equality didn't think it would be an issue.

    Equivalnce is rare and stand-alone, unlike equality comparison,

    I don't know what you mean by "stand alone". All of these operators are part of programs. IIRC, the introductory texts for Python put a great deal of emphasis on figuring out if your variables are stored in the same memory location, since IIRC Python does that a lot.

    it would be in a storage declaration,

    How do you test for "equivalence" between two things if they haven't been defined yet?

    as triple equal would be in an expression.

    So you would not allow a "triple equal" conditional expression? "If these two things are stored in the same memory location do this..." would be illegal?

  82. You misunderstand "equivalence" by Ungrounded+Lightning · · Score: 1

    How do you test for "equivalence" between two things ...

    You misunderstand "equivalence" in this context.

    It is not a test, not a kind of comparison. It does not direct the program to do anything,

    It is a declaration of storage allocation. It tells the compiler that two symbols refer to the same storage.

    In c, for instance:
      union {
          long int i;
          float f;
    } intflloat;

    Lets you say:
              intfloat.i = 0xfedcba89;
            some_float = intfloat.f;
    and some_float gets a floating point value whose bits are 0xfedcba89.; In SAN you'd say:

    int32 i
    float f
    i === f

    Then:
      i = 0xfedcba89
      some_float = f
    does the same thing.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:You misunderstand "equivalence" by Ungrounded+Lightning · · Score: 1

      Then:
          i = 0xfedcba89
          some_float = f
      does the same thing.

      Oops. Make that:
          i := 0xfedcba89
          some_float := f

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  83. Pointless excercise by jw3 · · Score: 1

    Anything that is used as often as a comparator doesn't really matter, because you will quickly learn to recognize and recall it. Call "greater than" "susan" and after a few days you will know what "A susan B" means without even thinking.

    However, if anyone found a better way to memorize things that you use once in a while (say, once a week or once a month); things like obscure class names in Java or particularities of certain R statistical packages (which parameter changes the direction of labels, was it "las" or "lus"? Does 1 mean "bottom" or "left" in the "pos" parameter? What was the name of that package that did this little thingy and had this nice function to produce such great plots...) then I would find the discussion not a complete waste of time.

    If only there was something to help us with that... like, if there were environments or editors that would enable us to quickly search available libraries, autocomplete, look up manuals...

    Oh wait.