Why is there no or or and ?

Brad Anderson eco at gnuk.net
Thu Feb 16 20:52:35 PST 2012


On Thu, Feb 16, 2012 at 9:35 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Thursday, February 16, 2012 22:31:18 Caligo wrote:
> > C++ has this and it makes code little more readable in certain cases:
> >
> > if(something() or foo() and bar()){  ... }
> >
> > instead of this in D:
> >
> > if(something() || foo() && bar()){ ... }
> >
> >
> > possible enhancement request?  or is there a good reason it is not in
> > the language?
>
> Since when does C++ have "or" and "and"? C++ uses || and &&, just like C
> and
> Java and C# and... I'm sure that there's a language somewhere whch uses
> "or"
> and "and," but I've never used one that did.
>
> 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.
>
> - Jonathan M Davis
>

They are in the 1998 standard (section 2.5, right below trigraphs, if you
are curious).  Nobody actually uses them.

Regards,
Brad Anderson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120216/5b273f04/attachment.html>


More information about the Digitalmars-d mailing list