== vs =

Richard Harter g-rh at cca.CCA.COM
Sat Apr 2 15:50:41 AEST 1988


In article <10205 at steinmetz.steinmetz.ge.com> davidsen at crdos1.UUCP (bill davidsen) writes:
>In the early 70's I designed a language based on B, called IMP. It ran
>on the Intel 8080 and GE 600 series, and cross compiled (in both
>directions). After talking to a number of people about the readability
>of the code, three changes were made in the language:

>	= was replaced by := to avoid confusion
>	== was replaced by = since assignment was different
>	!= was replaced with <> like BASIC

Jovial also uses <>.  This one doesn't matter so much.  I've never liked
:=.  It looks like some kind of baroque smilely face.  Oddly enough the
fortran solution is, in many ways, the best.  (Although one really could
do without those dots.)  It puts the various symbols in different spaces,
and makes = unambigiously assignment.  I have never quite understood the
conviction on the part of language designers that one has to use <,>, and
= for order relationships.  One gets the feeling that there are people who
feel that if it was done in fortran, it must be, ipso facto, wrong.

>I find it interesting that 15 years later = and == are still biting (or
>byting) people and we are still living with it. Perhaps in the next (P)
>language this will change.

Language P omits the equal sign entirely.  The P language human factors
subcommittee concluded that all usages of = lead to confusion.  :-)

-- 

In the fields of Hell where the grass grows high
Are the graves of dreams allowed to die.
	Richard Harter, SMDS  Inc.



More information about the Comp.lang.c mailing list