Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mruxe.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!pyuxww!mruxc!mruxe!cgw From: cgw@mruxe.UUCP (C Waldman) Newsgroups: net.lang.c Subject: Re: Precedent for use of = Message-ID: <115@mruxe.UUCP> Date: Fri, 20-Jun-86 11:36:39 EDT Article-I.D.: mruxe.115 Posted: Fri Jun 20 11:36:39 1986 Date-Received: Sat, 21-Jun-86 12:21:16 EDT Organization: Bell Communications Research, Piscataway, NJ Lines: 49 In article <1331@brl-smoke.ARPA>, kelem@aero2.arpa writes: > There is a 429 year precedent of using the symbol = for equality. ...quote deleted... > 1. There are over four centuries of mathematics using = for equals. > Using = to mean assignment is begging for confusing code. > > 2. Assignment is a relatively new concept and a new notation is warrented. > ":=" has enough precedent to serve this purpose. > > Is it really worth using a notation that is contrary to that of the more > universal mathematics, and thus guaranteed to confuse novices and catch pros > off-guard in order to type "=" instead of ":="? I think adding a few > characters to improve readability and understandability is worth the > time and effort. No, no, no! It seems like you are a little confused about the meaning of the equals sign in mathematics. It's true that math uses = for equals, C uses = for equals too. The problem is that there are three meanings of 'equals': "math uses = for equality" is a true, but totally ambiguous statement. The three meanings, as I see them: A) test for equality, as in 'is x equal to 6?' (interrogative) B) assignment of equality, as in 'let x equal 6!' (imperative) C) assertion of equality, as in 'on a right triangle the square of the hypotenuse is equal to the sum of the squares of the two shorter sides.' (declarative) Meanings B and C (and rarely A) are used in math, with only one symbol (=); and your claim that "assignment is a relatively new concept" is erroneous. In programming, we do not state theorems (yes, there are some programs that can chew up theorems, but they don't classify as programming languages), we are interested in telling the computer to DO something: therefore we are interested in meanings A and B. They are both 'equals', but in different senses. We need two symbols to avoid ambiguity. As a user of both C and Pascal, I can appreciate the logic in using the shorter symbol for the more commonly used meaning (I HATE typing :=, especially since you have to hit SHIFT to get the colon, half the time, if I'm typing fast, I get :+). If anything, maybe I would agree with a different symbol for meaning A, like ?= or =? or something, but it's not worth making a change. If it ain't broke, don't fix it.