News for hackers. Stuff that matters.
Re:What real life bad habits has programming given you? by andreyf on Wednesday January 28, 2009 @01:32PM (#454179)
Constantly wondering if people mean `or' or `xor' (I mean xor)
Re:What real life bad habits has programming given you? by paulgb on Wednesday January 28, 2009 @01:50PM (#454211)
"Lunch specials include salad or fries"

"Great, I'll have both!"

Re:What real life bad habits has programming given you? by lunchbox on Wednesday January 28, 2009 @07:14PM (#455491)
Related: when people ask me if I'd like "A or B" I wonder if people mean "A || B", to which I'd reply with true/false, or "max(A, B)", to which I'd reply with A (if I have higher preference for A) or B (if I have higher preference for B).

Here are two unambiguous examples:

"Are you a US citizen or permanent resident? Yes [ ] No [ ]"

versus:

"Would you like coffee or tea?"

In some settings, when they ask "A or B", it's hard to know which of the following set are valid answers: {{}, {A}, {B}, {A,B}}

Re:What real life bad habits has programming given you? by nihilocrat on Wednesday January 28, 2009 @03:32PM (#454435)
I find it's most often people say "or" when they mean xor, and "and/or" when they mean or.

So perhaps we should start saying either "or" or "ior" (inexclusive or).

Re:What real life bad habits has programming given you? by tlrobinson on Wednesday January 28, 2009 @03:56PM (#454734)
The "and/or" thing actually sort of makes sense if you take "or" to mean "xor", since (A XOR B) OR (A AND B) equals (A OR B)
Re:What real life bad habits has programming given you? by smanek on Wednesday January 28, 2009 @06:04PM (#455379)
So, slash is really 'or'?

Oh, my head.

Re:What real life bad habits has programming given you? by tlrobinson on Wednesday January 28, 2009 @07:18PM (#455498)

    english   logic
    -------   -----
    and       AND
    or        XOR
    /         OR
Actually, since (A XOR B) and (A AND B) are mutually exclusive, (A XOR B) XOR (A AND B) also equals (A OR B), so "/" could be "XOR" too.