3 ms·
If I were writing a linter I'd do the exact opposite: complain about a lack of parens if it might be confusing. I don't know if a / b * c is (a/b) * c or a / (b
by gweinberg 7y ago
If I were writing a linter I'd do the exact opposite: complain about a lack of parens if it might be confusing.
I don't know if a / b * c is (a/b) * c or a / (b*c). Don't tell me, no matter how many times I'm told I'll forget 5 minutes later.
- AnIdiotOnTheNet 7y ago> If I were writing a linter I'd do the exact opposite: complain about a lack of parens if it might be confusing. Last I checked this behavior was still on the roadmap for Zig. It would be a compile error to not clarify such expressions with parenthesis.
- trickstra 7y agoExactly. Linters often complain about the amount of whitespace as if readability was important, but then complain about "too much" readability of the operator precedence. Except one can cause a programming error while the other can't.