News for hackers. Stuff that matters.
Re:Which one will execute faster, if(flag==0) or if(0==flag)? by xyzzyz on Saturday January 08, 2011 @05:43AM (#2082816)
I use them conventionally -- it helps me avoid bugs like 'if(foo = 3)' instead of 'if(foo == 3)'. 'if(3 = foo)' just will not compile. The 'if(6.28 < theta)' is just a logical consequence.
Re:Which one will execute faster, if(flag==0) or if(0==flag)? by Luyt on Monday January 10, 2011 @05:58PM (#2090059)
My C/C++ compiler will give a warning on 'if (foo=3)'.

Python will throw a SyntaxError on 'if foo = 3:'.