The wonders of C (=/==)

Peter S. Shenkin peters at cubsvax.UUCP
Thu Mar 28 11:27:09 AEST 1985


>> It seems to me that the normally-cited "save keystrokes" reason for
>> the =/== choice cannot be correct...
>
>Wasn't "==" chosen for its obvious analogy to "!=", "<=", and ">=" ?
>That's what I've always assumed, at least.
>

The "save keystrokes"  assumption comes from p17 of K&R: 

	Since assignment is about twice as frequent as equality testing
	in typical C programs, it's appropriate that the operator be
	half as long.

...which I never was tempted to take as anything but a cute little quip,
and perhaps a subtle dig at PASCAL.  In these latter days, it would
no doubt be postpended with a ":-)".

In any case, I apologise for contributing to the discussion.  If the truth
be known, I'm very bored with it by now.



More information about the Comp.lang.c mailing list