Bit Switching - How?

Ray Lubinsky rwl at uvacs.cs.Virginia.EDU
Sun Apr 16 03:44:14 AEST 1989


In article <626 at gonzo.UUCP>, daveb at gonzo.UUCP (Dave Brower) writes:
> In article <18944 at 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 at amber.cs.virginia.edu (Internet) |
|                                        rwl at virginia                (BITnet) |
| Department of Computer Science,        ...!uunet!virginia!uvacs!rwl  (UUCP) |
| University of Virginia                 (804) 979-6188               (voice) |



More information about the Comp.unix.questions mailing list