3 ms·
Has been advocated before, notably in the Practice of Programming: "Parentheses specify grouping and can be used to make the intent clear even when they are no
by jergosh 16y ago
Has been advocated before, notably in the Practice of Programming:
"Parentheses specify grouping and can be used to make the intent clear even when they are not required. (...) Seasoned program- mers might omit them, because the relational operators (< <= == ! = >= >) have higher precedence than the logical operators (&& and ||). When mixing unrelated operators, though, it's a good idea to parenthesix. C and its friends present pernicious precedence problems, and it's easy to make a mistake."
- kragen 16y agoAmusingly, I sent a note to the authors of TPOP when it came out claiming that I had found a precedence error in some of the code in the book, between && and ==. But I had gotten it wrong.