Example within documentations of D seriously need some improvement.

Jonathan M Davis jmdavisProg at gmx.com
Fri May 27 10:24:30 PDT 2011


On 2011-05-27 06:31, Steven Schveighoffer wrote:
> On Fri, 27 May 2011 09:22:01 -0400, Andrej Mitrovic
> 
> <andrej.mitrovich at gmail.com> wrote:
> > On 5/27/11, Matthew Ong <ongbp at yahoo.com> wrote:
> >> http://www.digitalmars.com/d/2.0/operatoroverloading.html # people done
> >> C++ can understand others may not.
> > 
> > Well, explaining the concept of operator overloading should be a
> > separate topic. People who know what operator overloading is will look
> > in the language docs to figure out the syntax and use it right away.
> > 
> > Doesn't Java have operator overloading? A lot of popular languages
> > except maybe C have it, I think.
> 
> Last I checked they do not. It's why the String class has charAt instead
> of an equivalent opIndex.

LOL. Yeah. Java will never have operator overloading. That would be on the 
list of features that were considered unsafe. And I know plenty of folks who 
are against operator overloading for similar reasons. Java has a lot of great 
stuff going for it, but it's overly stripped down in terms of features in the 
name of simplicity and safety, and operator overloading is definitely one of 
those that didn't make it in and never will. IIRC, they can't even get 
closures yet, even though it's the feature that's being pushed for the most 
and the Java folks were at least planning on implementing it. They'll never 
get operator overloading.

- Jonathan M Davis


More information about the Digitalmars-d mailing list