Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site amdahl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!sun!amdahl!gam From: gam@amdahl.UUCP (G A Moffett) Newsgroups: net.lang.c Subject: Re: condition convention 'if (10 == j)...' Message-ID: <1456@amdahl.UUCP> Date: Sat, 27-Apr-85 00:16:42 EDT Article-I.D.: amdahl.1456 Posted: Sat Apr 27 00:16:42 1985 Date-Received: Mon, 29-Apr-85 00:06:23 EDT References: <137@bocklin.UUCP> Organization: Blue Mouse Trailer Resort, Hellmouth, CA Lines: 12 > To prevent silly mistakes like > if (j = 10) > I usually write > if (10 == j) > By putting the constant first, I ensure that the compiler will catch the > typo. I think this is a good idea. Any criticisms? The only problem I have with it is that I am not accustomed to reading code written this way. -- Gordon A. Moffett ...!{ihnp4,cbosgd,sun}!amdahl!gam