Also using spaces or multiple lines may mislead the programmer, suggesting priority :
a?b:c?d:e;a?b:c?d:e;
To me, it is always better to use parenthesis, on one line of code. If the line goes too long you should use variables (as in pattern 4 "No 'foo' variables") :
Nested ternaries can be tricky for their operator not having the same priority between programming langages :
Also using spaces or multiple lines may mislead the programmer, suggesting priority :
To me, it is always better to use parenthesis, on one line of code. If the line goes too long you should use variables (as in pattern 4 "No 'foo' variables") :
Still my preference goes to a non nested if/elseif/else blocks (i find it a lot clearer) :