From: justinj@... (Justin Johnson) Date: 2002-07-02T18:51:15+09:00 Subject: Re: Ruby implementation Q's > I have heard this mentioned a lot and never understood these comments. Can > you explain in more detail? Why do you think finalization happens too late > to be useful? Imagine that there is a class that manages bitmaps, sounds or other forms of large binary data. Perhaps a mixture, even. An instance of the class is created and used. When the instance is no longer referenced, it hangs around until a garbage collection is initiated, whereby it is deleted and then possibly finalized. The problem is, the data is hanging around until that point. Python (if I can mention the 'P' word here!) gets around this by using a reference counting system for garbage collection. The moment an objects reference hits 0, it can be safetly destructed. The problem is, I don't think reference counting is a good garbage collection strategy for a number of reasons. The problem is, you cannot predict when the finalization is going to happen. When an object is 'destroyed' it would broadcast to all it's objects for destruction thus creating a chain reaction. Ruby is a wonderfully dynamic language. On the fly, you can create variables for classes/modules/instances. Wouldn't it be consistent to be able to delete them too? Justin Johnson justinj@mobiusent.com