moving from c++ to D is easy?

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 12 11:57:50 PDT 2015


On 03/12/2015 06:01 AM, ayush wrote:

 > Is D a lot like c++ ?

I came to D from C++. I remember the following being notable differences:

- In D, classes have reference semantics. I quickly realized that this 
is not an issue because so many of my C++ types were 
hand-reference-typified :p by this idiom, almost everywhere:

class C { /* ... */ };
typedef boost::shared_ptr<C> CPtr;
void foo(CPtr c);

- Garbage collector took longer to get used to. There are some issues 
with the spec or implementation that some objects may never be 
destructed (or is it finalized?).

Other than issues like that, everything in D feels like a fresh air.

 > I am currently midway through learning c++

If you are a mortal like myself, you may find out years later that you 
are still at the midway point. Happened to me several times when I was 
learning C++. :)

 > and I also want to learn D . So should i focus on one or learn
 > both together?

Economically, C++ may make more sense. But if you are learning just for 
yourself, perhaps for fun, then I recommend D.

 > Will I find learning D easy if I already know c++ ?

I think so.

Ali



More information about the Digitalmars-d-learn mailing list