Precedent for use of =
Chris Torek
chris at umcp-cs.UUCP
Mon Jun 30 13:27:50 AEST 1986
In article <1645 at brl-smoke.ARPA> JUNG_E%SITVXA.BITNET at WISCVM.WISC.EDU writes:
>Why can't C be like everybody else?
It is too late for C to be like anything else; it is like C. Besides,
if it were exactly like (say) Pascal, it would *be* Pascal. There is
room for many languages.
>Practically every language uses the equals sign, "=", to test for
>equality, not as an assignment operator.
Perhaps you know more languages than I. Let me list those whose
syntax I remember, and count `= for assigment' vs. `= for equality'
(or both).
Assignment Equality
---------- --------
Algol
APL
awk
BASIC (really both)
FORTRAN
Icon
Lisp (neither really)
Mesa
Pascal
Snobol
Well, 5 to 3 in favour of `= for equality', though APL and Mesa are
perhaps special cases: back-arrow is not available for assignment on
my H19.
>Kernighan and Ritchie, in their infinite wisdom, decide
>instead to use "=" for assignments and to create a new operator, "==" to
>test for equality. Gee, that must have required brains, the brains of
>a 3 year old.
Both Brian Kernighan and Dennis Ritchie have quite a bit of experience
designing and using languages. Rather than spewing insults, it
might be more productive to do some studies as to whether the
symbols used for assignment and testing affect programming speed
and error rates, for both novice and experienced programmers.
Perhaps they did what they did because of some particular insight
that others have missed, or perhaps it was a mistake. As far as
I can tell, you have not even attempted to determine this
experimentally.
>If they had my brains, they would have used Pascal's method. Better yet,
>they should have let someone else write up C.
>Edward Jung, Stevens Institute of Technology
>JUNG_E at SITVXB.BITNET
If C were different, it would be different. That tells us nothing.
C as it is now is quite obviously rather popular. How many languages
have you designed, and who is using them?
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP: seismo!umcp-cs!chris
CSNet: chris at umcp-cs ARPA: chris at mimsy.umd.edu
More information about the Comp.lang.c
mailing list