English binary logic operators

Anders F Björklund afb at algonet.se
Fri Nov 24 07:13:18 PST 2006


Bill Baxter wrote:

> Unfortunately, if && and || are to be eliminated wholesale, the benefit 
> will be seen as too small to be worth the pain of fixing all old code. 
> Furthermore Walter believes that C/C++ syntax must be good enough or it 
> wouldn't have survived so long (or something like that).  And he 
> believes that D should look and behave like C/C++ as much as possible to 
> ease the transition for C/C++ refugees (hence the decision to not fix 
> how switch works).  He also believes that symbols (!@#$%^&*) should be 
> used wherever possible instead of new keywords (hence we have ':' 
> showing up everywhere for all kinds of different purposes, and "static" 
> with even more meanings than in C++).
> 
> It could be possible to add 'and' and 'or' as _synonyms_, but that 
> smacks as too many ways to do the same thing, and adds two keywords for 
> something for which there is already another way to do it.  It doesn't 
> let you do or express anything you couldn't before.

I think it's a sign of weakness that there can be only one way to do it:

If "and" is added, then && must go. If "is" is added, then === must go.

--anders



More information about the Digitalmars-d-learn mailing list