The purpose of D (GC rant, long)

Anders F Björklund afb at algonet.se
Thu Oct 26 03:55:13 PDT 2006


Serg Kovrov wrote:

> The real pain for me is that (as I see it) D is designed to be used with 
> GC. That is, operations with arrays and strings heavy relaying on GC. 
> When I say "D", I mean "D and Phobos". For me they are one thing.

I think that is one of the features of D. I miss my GC when doing C/C++.

> As bottom line, there are a few statements about me:
> - I am *not* a system developer. I am an application developer.
> - I'm very paranoid regarding resources (memory in particular).
> - I *do* like GC, but will use it only if I can fully control it (as 
> user, of course).

Sounds like C++ would be a better match, GC will be optional in C++0X ?


I think that garbage collection is a nice language FEATURE, and the only
part I don't like is when it doesn't work and the other remaining bugs.
But it *is* something of a must, once it's in the language and library -
I don't think you can use D without using GC in (parts) of your program.

See http://www.digitalmars.com/d/garbage.html for the rationale why.

I've used GC in both C (Apache "pooling" functions) and C++ (as a lib),
and it's useful there too ? I don't think you *have* to go to Java/C#.
Most of the time I don't miss managing memory resources manually more
than I miss writing assembler code, and computer is better at it too.

At least for me, D fills a niche between C and Java ? A simpler C++...

--anders



More information about the Digitalmars-d mailing list