News for hackers. Stuff that matters.
Re:Can (a ==1 && a== 2 && a==3) ever evaluate to true? by bfsg on Tuesday January 16, 2018 @04:16PM (#16162684)
It's a debug related question because it tests whether you realise "a" can be a getter. For the rest this line of code is so hideous, although it is accepted by the interpreter, it is in every aspect totally wrong to do such thing in your codebase.

This is a typical example of what is wrong and annoying with job interview questions. In a way it doesn't really matter if the line could possibly evaluate to true, it shouldn't be written in the first place. What in the world tells your NO answer about your skill to do the job you are applying for? That you're not smart enough? Come on, I'd be really pissed off with shit like this.

Re:Can (a ==1 && a== 2 && a==3) ever evaluate to true? by FabHK on Tuesday January 16, 2018 @04:20PM (#16162722)
You might have bugs in the real world that are caused by language features or idiosyncrasies that are visible in this artificial, small (thus more easily understood) toy example.

I often find these toy examples or trick questions (also in the context of C++ inheritance, for example) very instructive.