Path: utzoo!utgpu!water!watmath!dalcs!garfield!john13 From: john13@garfield.UUCP (John Russell) Newsgroups: comp.lang.c Subject: Re: == vs = Message-ID: <4403@garfield.UUCP> Date: 19 Jan 88 04:03:12 GMT References: <11216@brl-adm.ARPA> <2111@chinet.UUCP> Reply-To: john13@garfield.UUCP (John Russell) Organization: Memorial University of Newfoundland, St. John's Lines: 30 In article <2111@chinet.UUCP> dag@chinet.UUCP (Daniel A. Glasser) writes: >In article <11216@brl-adm.ARPA> RAY%TEMPLEVM.BITNET@CUNYVM.CUNY.EDU (Ray Lauff) writes: >' >'I do agree that changing the assignment operator to := would be a radical >'alteration of the language, causing many programs to require changes, but > >Actually, you have introduced a bug here -- You are changing comparisons >("==") to assignments (":="). Seems to me that the people who have problems with '=' vs '==' are those who have not come to terms with the implicit comparison with zero done after each operation. I made the = mistake a couple of times very early in the C learning process. But since I convinced myself that "if (x = fn())" was both a valid and useful construct, and put it to use in code, the *meaning* of each has become very apparent so that I use the proper form automatically. People who find the implicit test for zero distasteful (I get the feeling many of them never programmed in assembler) may never be comfortable with '=='. But for people who like it for its conciseness, the chances of using the wrong symbol due to a typo should be no greater than typing "mian" instead of "main". John -- "A Chinese soldier in Tibet who tried to tear off a British woman's Sergeant Bilko T-shirt has become the first known case of someone mistaking Phil Silvers for the Dalai Lama." -- Toronto Globe & Mail, Nov. 14/87