
20 Apr
2009
20 Apr
'09
4:59 p.m.
Jumping in here, the problem is that having to mix GC code, which automatically releases memory in a non-deterministic way, and normal RAII destructor code, which releases all resources in a deterministic way, creates two different syntaxes in a C++ program. This would currently require the programmer to "know" which type of destruction belongs with which object.
I think the overhead of knowing which type of destruction belongs to which object is minimal when compared to the overhead of manually tracking memory. Resources like memory should be tracked by a GC, resources like mutexes or files should be tracked by RAII. What I like in C++ is that I can use the best of both worlds at the same time.