Re: Syntax for OR
- Posted by jimcbrown (admin) Mar 04, 2015
- 1656 views
I wasn't going to guess.
But you did.
The specified '1' and '3' may have been easier to type for this illustration than the actual numerals in the actual code. I knew when i posted the first time that '(1 or 3)' could be reduced,
But (unless both numerals are zero) it's always reduced to the same value, regardless. I don't see how typing '(1 or 3)' is easier than just typing '1'.
but the secondary point i was making is next year the OP may not realise what his code was doing, and may be guessing as much as we were.
Aha! So Derek's interpretation was slighly off - this was a secondary point, not a major point!
I also support having the OP making nirs code as readable as possible by proper use of parentheses, as you suggest below.
Parentheses eliminate much of the arbitrary, and are second to comments to explain the intended program flow.
Absolutely.
guessing jimcbrown will feel compelled to post a response.
You guessed correctly.