Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!uvaarpa!virginia!uvacs!rwl From: rwl@uvacs.cs.Virginia.EDU (Ray Lubinsky) Newsgroups: comp.unix.questions Subject: Re: Bit Switching - How? Message-ID: <3090@uvacs.cs.Virginia.EDU> Date: 15 Apr 89 17:44:14 GMT References: <18944@adm.BRL.MIL> <626@gonzo.UUCP> Organization: U.Va. CS in Charlottesville VA Lines: 22 In article <626@gonzo.UUCP>, daveb@gonzo.UUCP (Dave Brower) writes: > In article <18944@adm.BRL.MIL> a unidentified co-conspirator says: > > x ^= z, y^= z; /* flip those that do */ > Rather: > x ^= z; /* flip those that do */ > y^= z; > > If you don't see _why_ this is the right way, you'd better not work on a > project with anyone but yourself. Alright -- I'll bite. Why (other than your personal preference) is the former an example of bad coding practice? It's equivalent to the latter. Don't get me wrong. When I write C programs I even put variable declarations one-per-line, so I, too, would prefer to see the latter, but I can't say unequivocally that it is the *right* way. -- | Ray Lubinsky rwl@amber.cs.virginia.edu (Internet) | | rwl@virginia (BITnet) | | Department of Computer Science, ...!uunet!virginia!uvacs!rwl (UUCP) | | University of Virginia (804) 979-6188 (voice) |