3 ms·
I don't remember all the rules, but I do remember that comparisons come before logical operations. It just doens't make sense to let a < b && c mean a < (b && c
by jules 16y ago
I don't remember all the rules, but I do remember that comparisons come before logical operations. It just doens't make sense to let a < b && c mean a < (b && c).
Perhaps an IDE/editor feature that removed unnecessary parenthesis could clean up code and you'd learn the precedence as you go.
- electrum 16y agoIntelliJ IDEA has intentions to "add clarifying parentheses" and "remove unnecessary parentheses". http://www.jetbrains.com/idea/documentation/intentions.jsp http://www.jetbrains.com/idea/documentation/intentions.jsp
- jules 16y agoThat's an interesting list. A lot of automatic code simplifications that I want :)