Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.6.2.17 $; site ccvaxa.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!inuxc!pur-ee!uiucdcs!ccvaxa!preece From: preece@ccvaxa.UUCP Newsgroups: net.lang.c Subject: Re: Re: using ^= to swap two integers (e Message-ID: <8800015@ccvaxa.UUCP> Date: Mon, 25-Feb-85 00:19:00 EST Article-I.D.: ccvaxa.8800015 Posted: Mon Feb 25 00:19:00 1985 Date-Received: Tue, 19-Feb-85 08:35:18 EST References: <173@phri.UUCP> Lines: 22 Nf-ID: #R:phri:-17300:ccvaxa:8800015:000:947 Nf-From: ccvaxa!preece Feb 17 23:19:00 1985 > >To exchange two items without an intermediate variable, try: > > b ^= a ^= b ^= a > > [and so on and so on] > Who cares? The xor trick may be cute, but if any programmer that works > for me tries to put that kind of crap in his code to make it run faster, > s/he should probably start looking for another job. Can we move this to > net.lang.c.worthless.trivia? ------------ It's silly to beat dead horses like the need for making programs run faster; if you have things where making things run a little faster will make them viable, you know the need, if you can live with things written well and not polished for speed, you're probably better off. The argumentative tone is a little much, though. The xor trick isn't that obscure and it's compact, so that attaching a simple comment explaining what's happening should be sufficient to make it acceptable. scott preece gould/csd - urbana ihnp4!uiucdcs!ccvaxa!preece