| ▲ | Groxx an hour ago | ||||||||||||||||||||||
tbh I've considered simply banning math-operator-precedence in projects I work on, and requiring all mixed-operator code to use parenthesis or split to multiple statements. I do that myself, at least.I've seen so many mistakes from it, and seen people spend so much pointless and avoidable time deciphering and verifying it, it really doesn't seem worth it (in most code) for the extremely minor character savings. | |||||||||||||||||||||||
| ▲ | om2 an hour ago | parent [-] | ||||||||||||||||||||||
- and + operators have the same precedence. And a similar bug is possible if the operators were the same (both -). So I’m not sure it’s right to blame this on operator precedence or mixed operators. It’s just that, ultimately, the “consume” needs to be subtracted, not added. | |||||||||||||||||||||||
| |||||||||||||||||||||||