Deterministic Memory Management With Standard Library Progress

bachmeier via Digitalmars-d digitalmars-d at puremagic.com
Sat Mar 4 18:00:40 PST 2017


On Saturday, 4 March 2017 at 18:09:10 UTC, Anthony wrote:
> To give context to my question, I don't have a problem with 
> GCs, and this question isn't stemming from a C++ background. 
> I've been told to learn C++ though, due to its efficiency and 
> power.
>
> It feels like D is a better choice for me to learn than C++; 
> it's ostensibly C++ but with various amounts of baggage or 
> unfavorable quirks removed. But I'm wary to learn if one of the 
> major proponents for C++ usage, deterministic memory 
> management, isn't directly supported. I check back here every 
> few months or so, but now I just can't find anything new.

Having learned C++ before D, I would argue (others will disagree) 
that even if your goal is to learn C++, you should start with D. 
You want to learn certain concepts and ways of thinking. If you 
start with C++, you have to spend your time learning the rough 
edges of C++ and what not to do, and it really does interfere 
with your learning. It's faster to learn D and then figure out 
how to do the same thing in C++ than to battle with the 
unpleasantness of C++ from the start. I regret all the hours I 
wasted on C++.

It's not really accurate to say someone should avoid D because of 
GC/memory management. You can call C++ from D, so while the 
cost-benefit analysis might favor C++ in some cases, there's no 
reason you can't write your program in D and then call into C++ 
when absolutely necessary. I do the same thing, except that I 
call into C more than C++.

Just my 2 cents as someone that does numerical programming. 
Ultimately, if you're looking at it from the perspective of the 
job market, it really doesn't make sense to spend time on D. If 
the goal is to learn, it doesn't make sense to spend time on C++.


More information about the Digitalmars-d mailing list