Why is there no or or and ?

bcs bcs at example.com
Thu Feb 16 22:05:06 PST 2012

On 02/16/2012 08:53 PM, bearophile wrote:
> Caligo:
>> possible enhancement request?  or is there a good reason it is not in
>> the language?
> I have asked for them, but Walter doesn't want, he thinks C/C++ programmers will not use them... :-( Despite D != C/C++.
> ----------------
> Jonathan M Davis:
>> And I'm actually mildly shocked that anyone (at least any programmer) would
>> think that "or" and "and" were more readable. The fact that operators aren't
>> words is a _major_ boon to code readibility.
> This is very very wrong. Of course that "or" and "and" are more readable. When you read "and" it's immediate to think it's probably related to the AND logical or binary operation more than meaningless symbols that are unrelated to "AND".

'and' & 'or' are just a patch of meaningless squiggles with no more or 
less meaning than '&&' and '||' have. They have the meaning we impart to 
them. Personally, I associate '||' with the idea of disjunction just as 
much as I associate 'or'.

Having the operators and the key-words/identifiers from different sets 
of characters, IMHO make things easer to read.

> "or" and "and" are about as long as those symbols in char count, quicker to write because they are lowercase letters instead of symbols, and they are much simpler told apart from bitwise&  |. This avoids some bugs where people use "&&" where they want to use"&" or the other way around. Such bugs are so common that D have had to introduce one or two rules to help avoid them.
> Python got this waaaaay much better than D. Using "&" for (uncommon, in Python) binary ops, and "and" for the common logic boolean operation.

In a debate about readability, I don't give much weight to an argument 
that holds up Python as an ideal. Semanticly significant white-space? 
Are you kidding me?

More information about the Digitalmars-d mailing list