NYCPHP Meetup

NYPHP.org

[nycphp-talk] Questions to ask at a job interview?

csnyder chsnyder at gmail.com
Sun Jul 8 18:30:32 EDT 2007


On 7/8/07, David Krings <ramons at gmx.net> 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/



More information about the talk mailing list