| ▲ | om2 an hour ago | |||||||
- 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. | ||||||||
| ▲ | Groxx an hour ago | parent | next [-] | |||||||
Non-mixed always goes strictly left to right, regardless of the operator, which I haven't seen anywhere near as much struggling with. But yes, I personally parenthesize `a-b-c` explicitly, because it's not worth it for me to read and wonder if parenthesizing order matters later. Costs less than a second to write, saves a second or ten each time I read it - that's an excellent tradeoff imo, and is a trivial pattern to follow. (Associative operators are fine, obviously) | ||||||||
| ||||||||
| ▲ | genxy 37 minutes ago | parent | prev [-] | |||||||
Didn't you just suffer from the same trap the parent was trying to avoid? | ||||||||