News for hackers. Stuff that matters.
Re:Which one will execute faster, if(flag==0) or if(0==flag)? by Luyt on Saturday January 08, 2011 @01:16AM (#2082436)
You're right. I think it's just what people are used to. Compare:

"If two gallons is less than the amount of gas in your tank, you should fill it up."

"If you have less than two gallons of gas left in your tank, you should fill it up."

In everyday speech, as well in mathematics, it is usual to state the variable first (what are we're going to compare) and then the amount to which it will be compared.

Re:Which one will execute faster, if(flag==0) or if(0==flag)? by __david__ on Saturday January 08, 2011 @02:58AM (#2082610)
The first is especially awkward because you forgot to flip the < into a >. It should be, "If two gallons is greater than the amount of gas in your tank, you should fill it up."
Re:Which one will execute faster, if(flag==0) or if(0==flag)? by wnoise on Saturday January 08, 2011 @01:53AM (#2082497)
The second actually splits the variable across the comparison. ("you have" and "left in your tank").