In teaching students programming, invariably we always come to a discussion about order of operations. Anyway, using parentheses will always affect the order of operations regardless of the standard algebraic rules. After going through lots of examples, the principle that is pronounced for all to abide by--"Always be explicit about what you want to do by using parentheses, don't leave anything to chance."
Well, not following this principle bit me today. The process went something like:
((x or y) and z) or ((x or w) and z) or x = 1 and a=1
What we really wanted was:
(((x or y) and z) or ((x or w) and z) or x = 1) and a=1
The parentheses are evaluated first, then the "and" then the "or". The difference in parentheses makes the difference between a couple results and a couple thousand results. Lesson learned. Illustration gained.