News for hackers. Stuff that matters.
Re:Visualising the .NET Garbage Collector by josteink on Tuesday June 21, 2016 @03:54AM (#11944163)
> For example could it represent RAII with an imaginary destructor in C# reasonably well?

Not going to comment on the rest of your post, but just in case you didn't know, there's no need for an imaginary destructor in C#, as it already has one.[1]

The reason it's not really much known (or used) is because of its indeterminstic GC-tied nature.

I think the only "valid" usage I've seen for it is as a fallback method for IDisposable objects which are not getting cleaned up as they should (and as a way of tracing that in debug-builds).

[1] https://msdn.microsoft.com/en-us/library/66x5fx1b.aspx

Re:Visualising the .NET Garbage Collector by vishbar on Tuesday June 21, 2016 @04:18AM (#11944278)
The "canonical" implementation of IDisposable includes a finalizer. As you said, that's the only time I've seen it used. Adding finalizers to classes has performance implications as well as the CLR will add any object with a finalizer to the finalizer queue (hence the GC.SuppressFinalize(this) you always see in implementations of IDisposable).