LinkedIn Article to be: Why you need to start moving off C/C++ to D, now.
Tobias Müller via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jul 17 12:58:32 PDT 2014
"Paulo Pinto" <pjmlp at progtools.org> wrote:
> On Tuesday, 15 July 2014 at 21:11:24 UTC, John Colvin wrote:
>> I've been wondering about this. Could the following argument be > true?
>>
>> Situations where automatic memory management are necessary are,
>> by definition, the situations where one cannot easily reason
>> about where memory freeing can occur.
My experience is completely different:
1. Shared ownership is rarely necessary.
2. Where is is necessary, deallocation often happens at the same (or a few
similar) _code_ location, just the actual _object_ that triggers
deallocation is different at runtime.
>> Therefore, no automatic
>> memory management system can be considered practically
>> predictable, unless you didn't* need it in the first place.
>>
>> *strictly speaking
>
> Which happens all the time in any codebase written by more than one developer.
>
> Developer attrition and third party libraries help to the entropy of memory leak bugs.
>
> Personally, I don't believe anyone is able to reason properly about
> manual memory management, unless they wrote 100% of their code, and don't
> work in more than one codebase.
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
More information about the Digitalmars-d
mailing list