On 7/8/07, David Krings <[EMAIL PROTECTED]> wrote:
csnyder wrote:
>> Thanks to Google I now know the answer:
>> $x = $x xor $y;
>> $y = $x xor $y;
>> $x = $x xor $y;
>
> Heh. If you gave me that answer I wouldn't hire you.
> Good luck at Google, though.
Uhm, just out of curiosity....is that answer wrong (just because Google
shows it as a result, doesn't mean it is right, but the page I got it
from gave a plausible explanation)?
Undoubtedly, my skills in software QA, support, and tech writing are
better than my programming skills.
Well, give it a try in php and see if it works.
But actually, my response was a knee-jerk reaction against code tries
to be clever when simple would work just as well.
Your first instinct, make a copy and then reassign the values, is a
straightforward way to do it. Other developers--web developers--will
immediately understand, and not have to audit your code to figure out
what's happening.
Don't let lack of computer science theory psych you out of being a
good engineer.
--
Chris Snyder
http://chxo.com/
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php