shorter foreach syntax - C++0x range-based for

Bruno Medeiros brunodomedeiros+spam at com.gmail
Wed Nov 24 13:45:14 PST 2010


On 01/11/2010 15:14, Andrei Alexandrescu wrote:
> On 11/1/10 9:09 AM, Gary Whatmore wrote:
>> 2) the syntax comes from Java. It
>> would be embarrasing to admit that Java did something right.
>>
>> - G.W.

Only if one is an idiot.

>
> Java did a lot of things right (be they novel or not) that are present
> in D, such as reference semantics for classes, inner classes with outer
> object access etc.
>
> Andrei

A few more things:

Annotations: a very flexible and extensible system to add metadata to 
any kind of definition. Meta-data can be runtime, compile-time or both. 
D could take a lot of inspiration from Java's annotations.

Integrated support for multi-threading: threads, monitors, 
mutexes/locks, synchronization, etc., are part of the language, 
including more advanced synchronization constructs such as condition 
variables. And also a well defined memory model! In fact D took direct 
inspiration from Java on this, did it not?
Also, very good, very well thought concurrency utils (the stuff done by 
Doug Lea).

Wildcards in generics: a very interesting mechanism for increasing type 
safety. Java wildcards were not done right in every aspect, but still 
they are very nice, and I don't know of any mainstream languages that 
have anything quite like that, or even close.


-- 
Bruno Medeiros - Software Engineer


More information about the Digitalmars-d mailing list