D - more or less power than C++?

Lars Ivar Igesund larsivar at igesund.net
Sat Mar 4 03:43:42 PST 2006


Johan Granberg wrote:
> 
> You did not answer the above statement and i have seen this repeated all
> over this thread along with destructors in structs. I will not repeat
> all the arguments but to me this is important issues.
> If i should rank the most showstoping things in D (from my perspective)
> it would be
> 1. bugs
> 2. as far as I know no way of inporting somthing in a parent directory
> (as C++ #include "../myheader.hpp")

If you have a package hierarchy:

foo/
foo/bar/

and the files
foo/a.d
foo/bar/b.d

you can in your foo/bar/b.d do

import foo.a;

For good measures, name your modules accordingly with the module statemnt:

module foo.a;
----------
module foo.bar.b;
-------------

> 3. read only sematics that work as a strong reminder that one is not
> suposed to modify somthing (but can bee subverted by a cast)

Walter has answered on this very many times earlier, and he thinks const
ain't the correct solution. Whether he'll find some other is still an open
question.

> 4. overlodable assignment and copy constructors.

Also discussed very many times in the past, Walter's opinion is that they're
bad for you ;)

> 5. library and other minor issues

Library is IMHO a community issue, nothing to do with the language, which
was the question here.

> 
>>> 4. library
>>> ...
>> I don't find the STL compelling, either, and that's the only library
>> thing standard C++ has over libc. Furthermore, large chunks of STL are
>> simply irrelevant in D because D has core arrays, strings, and
>> associative arrays.
> 
> I agree on this one. So wath is your plan for the D standard library?

I do agree that phobos is not the most compelling std library out there,
which is why I encourage helping out with Ares.



More information about the Digitalmars-d mailing list