You can find it in the C # 4.0 Language Specification "Except for assignment operators, all binary operators are left-associative"
FYI this line is a mistake. The zero-coalescing operator is also right-associative β no matter what it matters. See fooobar.com/questions/10383 / ... for John a great analysis of this problem.
Will it be executed with a difference for the equality operators == and != , Working only on bools?
Not. As you correctly noted, the associativity of operators does not matter when working only with equality operators and only with bools. Although this is an interesting little thing, I do not know why this is especially important.
Many people answered that it matters because operands can have side effects. These people are mistaken; This is an extremely common mistake. The order in which the operands are evaluated has nothing to do with the priority or associativity of the operators. In C, for example, the corresponding implementation allows you to calculate side effects in any order. If you say:
x = (A() != B()) == C(); y = D() != (E() == F());
In C, you are guaranteed that D (), E (), and F () are not executed until A (), B (), and C (). But you are not guaranteed that the side effects of B () are calculated before C (). A (), B (), and C () can be executed in any order in C, legally. Associative associativity, "natural" or imposed by parentheses, does not impose any restrictions on the order in which side effects can be calculated.
In C #, the situation has improved a bit. In C # you are guaranteed that the side effects of the operands will be executed from left to right , regardless of the priority or associativity of the operators . That is, if you have A() + B() * C() , then you are guaranteed that A () will happen before B () and that B () will happen before C (), regardless of what A ( ) participates in an addition that has a lower priority than multiplication.
The priority and associativity of operators control the order in which the operators work, and not the order in which the operands are calculated.