> every programmer worth his money just knows that ?: is right associative
I would hope every programmer worth their money are very comfortable with it, because chaining like this is a very common syntactic pattern in other people's code:
cond1 ? val1 : cond2 ? val2 : cond3 ? val3 : other
It is made less readable if you turn it into a right-nested mess of parentheses, so that is rarely seen.
Just as nobody thinks of 'if..else' as right associative, but it actually is, and everyone uses that fact without thinking about it.
Same for '?:'. The associativity is just a formality that nobody thinks about.
> '&&' is on precedence level 11 while '?:' is on 13
On this I agree. I routinely put parentheses around complex conditions on the left side of ternaries for this reason.
I do remember the precedence, but I think leaving the parentheses out can raise a little doubt in the reader's mind, because it is common to use logical operators for control flow in languages like JavaScript, and control flow is at the same conceptual level as '?:'.