C tips (again)

bearophile bearophileHUGS at lycos.com
Sat May 2 10:01:12 PDT 2009


Walter Bright:

>I clicked on that one at random. I think this is much less of an issue with D than with C, because C's memory corruption problems are nearly entirely related to its reliance on pointers and manual memory management.<

This is true, most of D code just doesn't use so much pointers, etc. So those problems are much less common. On the other hand, I have used D to implement some data structures, and in such situations I often have to use pointers, etc.

Regarding the "manual memory management", most of the times you can just ignore the issue, and rely on the GC. But when I want to design an efficient data structure in D, I must deal with the GC, and this is usually more complex/messy than implementing the same code in C.

Anyway, you have much more experience than me in C programming. So if you think those things of ctips aren't much useful in D, then I have to trust you... :-)

Bye,
bearophile



More information about the Digitalmars-d mailing list