LinkedIn Article to be: Why you need to start moving off C/C++ to D, now.

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 17 14:04:47 PDT 2014


On Thursday, 17 July 2014 at 19:58:32 UTC, Tobias Müller wrote:
> IMO manual memory management is quite easy. In 99% of all cases 
> ownership
> is clear to trivial.
>
> But maybe this is just because I usually write C++ and 
> ownership is crucial
> in C++. Maybe it's more difficult if your accustomed to a GC.
>
> Tobi

Except that you and I both do a shitton of stupid mistakes when
coding all the time. And if you think you don't, you probably do
a lot more than I (as being blind to one's own weakness usually
don't help improving).

As a result, even when hat needs to be done is obvious (which it
is quite often when it come to memory allocations) mistake will
creep in.

Memory allocation mistake are special. They lead to memory leak
(which won't show up in tests, but only after the program is long
running, which lead to long and annoying debuging experience
where you try to analyze the heap and find how the hell you ended
up allocating all of this) or worse, undefined behavior (which
typically will cause crashes in unrelated part of the code,
leading to even more confusing debuging sessions).

As such, automatic memory management has value in itself. It is a
safe default. I understand that manual memory management is often
needed, and that is why we need way to escape that and manually
manage.


More information about the Digitalmars-d mailing list