D - more or less power than C++?

Sean Kelly sean at f4.ca
Fri Mar 3 13:39:07 PST 2006


Walter Bright wrote:
> I started a new thread for this:
> 
> "Mike Capp" <mike.capp at gmail.com> wrote in message 
> news:dua67i$12cr$1 at digitaldaemon.com...
>> 7. D has all (well, most of) the power of C++
> 
> I see this often and am a bit perplexed by it. What power do you feel is 
> missing?
> 
> And what about the missing power in C++ - inline assembler, nested 
> functions, contract programming, unit testing, automatic documentation 
> generation, static if, delegates, dynamic closures, inner classes, modules, 
> garbage collection, scope guard?

C++ has marginal inline asm support, even though no one supports the 
official syntax :-)  Much of the rest I'd consider unimportant as it 
doesn't impact what's possible in D so much as how easy it is to 
accomplish a task or how easy it is to verify that the solution is 
correct.  Some language advantages I think D has over C++ are:

- delegates
- dynamic closures
- scope guard
- volatile (and therefore some support for concurrency)
- synchronized (syntactic sugar but for its implications on language 
support for concurrency, much like volatile)
- inner classes (don't use them, but they are something C++ doesn't do)
- modules
- garbage collection (arguably an advantage as this can be accomplished 
in C++ by overriding global operators new/delete)

> What does D have to do to have more power than C++? 

Better RTTI might be nice perhaps.  But frankly, I think the power is 
already there.  What D needs to do now is prove itself.


Sean



More information about the Digitalmars-d mailing list