Two conditions in an IF statement. First is FALSE

Hi.

FORMAT 1

 if (analogRead(button) == HIGH && varX== 1){

//do something
}

vs.

FORMAT2

 if ( varX== 1 &&analogRead(button) == HIGH){

//do something
}

My question is if varX is 0 (FALSE) would it make a difference in formatting the IF statement in terms of code cycle duration? Being that "analogRead" takes some time. In FORMAT2 will the program still execute an analogRead even though the first condition is FALSE?

Thanks

The test will stop as soon as one of its components does not match the condition, so it makes more sense to put the fastest executing condition first

UKHeliBob:
The test will stop as soon as one of its components does not match the condition, so it makes more sense to put the fastest executing condition first

This is important because it can cause a nasty subtle bug. If one of the function calls you make in your if has side effects, this short-circuit q.v. behaviour may cause unpleasant surprises when you rely on those side effects happening.

If two of the function calls you make in your if have side effects you are up the creek without a paddle unless you put the return values in variables before the test and use the variables in the test

Actually, putting the return values in variables is better for debugging anyway