First, make sure that you are not a victim of premature optimization.
With that said, make sure you do your best to speed up the bottleneck in your program.
Doing what you said about the short circuit may be a good idea in some cases, but it depends a lot on all of your statements.
For example, if you have something like:
if(slowFunction() && complexConditionRootsAndExponents && ConditionUsuallyZero)
then you probably want the last term to be the first, right?
However, be careful, things are not always trivial to rearrange in a logical sequence. Check for example my answer in Why did this program print fork 4 times? where you can see that a short circuit can affect the flow of the program.
TL; DR
In general, however, it is rarely possible to achieve significant acceleration by rearranging terms in conditions. Focus on the bottleneck of your program and deal with it as much as you can!
gsamaras
source share