Re: Syntax for OR

new topic     » goto parent     » topic index » view thread      » older message » newer message
katsmeow said...

I wasn't going to guess.

But you did.

katsmeow said...

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'.

katsmeow said...

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.

katsmeow said...

Parentheses eliminate much of the arbitrary, and are second to comments to explain the intended program flow.

Absolutely.

katsmeow said...

guessing jimcbrown will feel compelled to post a response.

You guessed correctly.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu