Re: If GC is the solution, then what is the problem?
Le Chaud Lapin wrote:
charleyb123@gmail.com wrote:
All GC does is say, "I create objects but don't feel like defining
an owner, so I just leave my mess for the janitor, whom I assume
will clean up for me in a proper way."
Well said.
Ironically, after the mess is created, the creator of the mess often
spends days (sometimes weeks) trying to recover the determinism that
was lost by GC. I have already seen in recent months several occasions
where a GC evangelist got himself into a nasty situation with
garbage-collected code, fiddled around with his nasty code for a few
days, then finally resorted to consutling a non-GC person to help him
figure out how to force his GC stuff to be more deterministic. It's
comical to watch.
The "Nettting C++" article of this month touches on the same issue:
http://msdn.microsoft.com/msdnmag/issues/06/08/NettingC/default.aspx
That article presents code which is written in C++/CLI.
C++/CLI is a .NET language... complete with GC.
It is a different language than Standard C++.
But anyway, the very first line of the very first code sample in that
article
is:
public ref class TQL {
The keyword "ref" does not exist in standard C++, nor is it needed.
The keyword "public" is not used that way in standard C++.
There was a HUGE discussion about the name "C++/CLI", not long ago
(and very heated, for a moderated group)... As I recall, the only real
agreement was that C++/CLI is a different language than Standard C++,
despite having such a similar name. Disagreement about whether this
was evil or not. But note that the Microsoft Visual Studio compiler
(which
supports C++/CLI) also supports Standard C++. But you have to
understand the difference.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]