'=' vs '<-' vs '.ne' vs '==' vs ':=' vs '.eq.' vs ...

Silver gaynor at topaz.RUTGERS.EDU
Sat Jul 5 16:36:21 AEST 1986


[Line-Eater, hear me!  Eat this message, or I'll be flamed for sure!]

I've been following this discussion with polite attention, and decided
what the hell, here's my two cents (probably the value of the opinions
anyway, hee-yuk).

I give my preferences, and why.

ASSIGNMENT  <-

It visually seems more consistent with the programming paradigm, 'move
this value there'.  Mathematically, '=' is usually interpreted as 'it
is asserted that these two expressions are equal'.  To illustrate, can
you imagine what errors C or Pascal would generate on a statement like
x * x = 9?  Of course, it's a totally different story with an
assertive, relational language.  In addition, I don't care that it's
two strokes.  If I *really* minded, I would set-key-globally a
rarely-used key like '`' from self-insert to insert-<the-desired-
operator-of-more-than-one-character> (emacs is real nice about things
like this).

EQUALITY  =

Now, with '=' free, it can be used in a way more like it's
mathematical interpretion ('it is asserted...').

INEQUALITY  <>

I like it's visual symmetry, giving each side of the expression the
'half-operator''s mirror image of the other side (hard to express, you
know what I'm trying to say - neither side is favored).  Not so with
'!=', '~=', '|=', ...  Another connotation is that it is a 'true'
assertion, rather than a 'false' one.  That is, a <> b is literally
read as 'a is less than or greater than b', whereas a != b is read as
'a is not equal to b'.

By the way, do(es) any language(~s) implement these choices?

Go ahead then.
postnews re: "...!topaz!gaynor re: '=' vs '<-' vs ..." \
  | much-hellfire-and-brimstone


                         _   /|
                         \`o_O'
                           ( )   Aachk! Phft!   
                            U

Disclaimer: The opinions and/or information and/or code expressed
            here were generated by this characature, stolen from
            Dave Rasmussen, to which I have taken the liberty of
            adding ears.  So don't look to me for a disclaimer!

Silver  {...!topaz!gaynor}



More information about the Comp.lang.c mailing list