Path: utzoo!mnetor!uunet!seismo!sundc!hqda-ai!yendor!fujiirm From: fujiirm@yendor.UUCP (Roger Fujii) Newsgroups: comp.lang.c Subject: Re: == vs = Message-ID: <83@yendor.UUCP> Date: 19 Feb 88 22:06:00 GMT References: <11523@brl-adm.ARPA> <909@micomvax.UUCP> Organization: Applied Computing Technology, Reston, VA Lines: 56 In article <909@micomvax.UUCP>, ray@micomvax.UUCP (Ray Dunn) writes: > In article <11523@brl-adm.ARPA> dsill@NSWC-OAS.arpa (Dave Sill) writes: > >Does it make sense to change the language because some people have a > >problem making the abstract <=> real transformation? > > Yes. Otherwise it will eventually be the cause of someone's death, and that > death is avoidable! This argument is doesn't work. There is a BETTER chance of killing someone if you CHANGE the language ("Oh, How was I supposed to know you were going to use an OLD compiler where the = meant something else"). Changing the language defeats one of C's strong points - portability. > To others who suggest defining "EQUALS" etc for "==". This is not a > solution. The problem is not with the use of "==", the problem is with the > use of "=". The solution *has* to involve the "=" operator. It > unfortunately cannot be solved without breaking existing code - although > only to the extent that syntax errors would be given on existing code by > "new" compilers. "Solution" implies there is a problem with the language. I state that the problem is with the USER. Follow the following example: C is the *FIRST* language that you learn. For a "pure" novice (one who has NOT been tainted with Fortran, BASIC.....), the =/== will have clear, distinct and sensible meanings (except for the occasional typo, which is easier to find than a mistyped number - ah, you're going to redefine numbers now.... :-). > > The "best" solution suggested so far was to disallow "=" in the context of > the conditional expression of an if statement, and substitute some other > operator, say ":=" (but not necessarily). > Good, so ban cars that go faster than 20 mph because some people can't handle that speed. The whole point is this: C is fairly consistant (I don't want to hear about <<,>>). Changing the =/== in C is like changing forth to compute numbers using the order of operations (slight :-) overexaggeration, but you get the point). C is a powerful language, and it derives its power by being "close" to the machine. This necessarily implies that it can also be very DANGEROUS if used carelessly (as with any other powerful things). *** C IS NOT A LANGUAGE FOR NOVICES *** If you expect C to protect you from what you are telling it to do, you are not being realistic. Now, I am sure that you won't find too many complaints if you GIVE a compiler a flag to *warn* you if you do assignments in ifs (cc -trainingwheels hello.c), but this should only be a diagnostic tool. The =/== does function and is consistent. Remember the old saying - If it ain't broke, don't fix it. -- Roger Fujii - ACT, Reston, VA Phone: (703)471-9433 Internet: fujiirm@cml.rpi.edu UUCP: ..!{mimsy,sundc}!{prometheus,hqda-ai}!yendor!fujiirm