PBP: 048 Low-Precedence Operators

The best practice is not to mix low and high precedence boolean operators.  This is both good and bad, but following the rule can save your sanity.

The problem with mixing the low precedence operators – the nice ones that are words – and the high precedence operators – the C-like punctuation – is that it’s easy to forget which one will bind to what and have the wrong operator applied.

In general, the book suggests using only the high precedence operators for boolean operations, and the low precedence ones for specifying fallback operation s, like “or die…”.

This is probably good advice, but I am made sad by it, as I’d rather use words that squiggly punctuation.  Whenever I do, though, people are afraid and unsure and then they screw it up.  So it’s really not a good idea.

Leave a Reply