Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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."



Amusingly, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: