Why is there no or or and ?

David d at dav1d.de
Fri Feb 17 07:50:00 PST 2012


Am 17.02.2012 15:02, schrieb James Miller:
> On 18 February 2012 02:35, David<d at dav1d.de>  wrote:
>>> Python also uses "&" for set intersection afaik.
>>
>>
>> Yes, but that's an overload of the&-Operator and it makes sense.
>>
>>
>> We should add "and" and "or" this makes the Code way more readable, imo.
>
> But I spent years learning&&  and ||, when I read code, these patterns
> jump out at me. Sure they aren't as "readable" but we're writing a
> program here, not the Illiad. I write in a programming language, not
> english, if I wanted to write in english, I'd go be an author, or a
> journalist.
>
> As people have mentioned, it only makes the code more readable (and
> even that is under debate) for english-speaking users, foreign
> language users are at even more of a disadvantage, since the have an
> extra step of analysis to figure out what it means, especially since
> there might not always be a simple translation.
>
> Don't think of&&  and || as `and` and `or`, think of them more as
> logical conjuction and disjunction, they are predicate operators.
>
> And if we want to get into "proper" symbols for logic, we should be
> using ∧, ∨, ⊕, ¬ for and, or, exclusive or and not, since those are
> the proper boolean algebra symbols.
>
> --
> James Miller
Then use Haskell :P. http://www.haskell.org/haskellwiki/Unicode-symbols

Everyone who codes in the "D programming language" knows english, since 
the whole internetz is english, like the D documentation, so it 
shouldn't be a problem to get the meaning of "and" and "or".


More information about the Digitalmars-d mailing list