Wiki Markup |
---|
Programmers frequently make errors regarding the precedence rules of operators due to the unintuitive low-precedence levels of {{&}}, {{\|}}, {{\^}}, {{<<}}, and {{>>}}. Mistakes regarding precedence rules can be avoided by the suitable use of parentheses. Defensive use of parentheses, if not taken to excess, also improves code readability. The precedence of operations by the order of the subclauses are defined in the Java Tutorials \[[Tutorials 08|AA. Java References#Tutorials 08]\]. |
The recommendation EXP30EXP09-J. Do not depend on operator precedence while using expressions containing side-effects advises against depending on parentheses for specifying the evaluation order, however this advice is applicable only to expressions that contain side-effects.
...