News for hackers. Stuff that matters.
Re:How to Score a Google Onsite Interview by Jach on Sunday May 01, 2011 @02:52AM (#2502553)
I noted that ("x" == x) avoids the problem of (x = "x") that others mentioned, but really, any sane compiler will warn you about the second. (GCC does, mxmlc does, Python flat out disallows the syntax.) The way to shutup the warning is to say ( (x = "x") ) if you really mean it.

I was more worried that the language in question was C++, so you have to worry about conversion constructors, conversion operators, operator==, etc.

Re:How to Score a Google Onsite Interview by allenc on Sunday May 01, 2011 @01:56PM (#2503559)
Agreed, although some laxer languages - say, Javascript - will let you do it all the same. Like I said, it's not necessarily a rule to follow, but whenever I come across people who would do things slightly off (from common coding practices anyway) I notice the difference, and if it's something I recognize I put a little mark there in case they're really, really close. I come from a C++ background, so stuff like i++ and ++i really do make a diff.