Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!lll-crg!seismo!umcp-cs!mangoe From: mangoe@umcp-cs.UUCP (Charley Wingate) Newsgroups: net.lang.c Subject: Re: Re: Precedent for use of = Message-ID: <2323@umcp-cs.UUCP> Date: Thu, 10-Jul-86 01:20:21 EDT Article-I.D.: umcp-cs.2323 Posted: Thu Jul 10 01:20:21 1986 Date-Received: Fri, 11-Jul-86 06:36:59 EDT References: <4824@sun.uucp> <499@cbmvax.cbmvax.cbm.UUCP> Organization: University of Maryland, Dept. of Computer Sci. Lines: 36 Dave Haynie writes: >> Personally, I still prefer := for assignment and = for equality over = >> and ==. I also think that the keystroke argument is ridiculous. The >> problem with = and == is further aggravated by the fact that in C an >> assignment is an expression and not a statement, so that code like >> if (i = 0) { >> /* do something */ >> } >> else { >> /* do something else */ >> } >> is legal C and usually /* does something else */ than you expected :-) >As long as you're writing in C, and you REALLY know the language, the above >construct would be ridiculous. I think that most of the folks that are >unhappy with the way that C handles = and == are frustrated Pascal hackers >who can't quite adjust to the power and terseness of C. Maybe if they'd >spend a few extra hours LEARNING C instead of trying to write Pascal in C, >they'd be much better off.[...] My point is instead of >tripping over the language syntax and screaming how it should be changed, >one can learn the language and then not have to worry about tripping over >it. And then you might even start to realize why a particular method has >its advantages. Unfortunately, it's that kind of attitude that leads to the perpetuation of bad language constructs. C's handling of assignment and equality is a problem: it is error-prone. What's worse is that one often sees code like "if (a=b)" done on purpose-- yet another example on how the "power and terseness" of C leads to obfuscation. C. Wingate