Visual Basic Reference Counting vs. .NET Garbage…

less than 1 minute read

Visual Basic Reference Counting vs. .NET Garbage Collection.

_My first article. "I work with a few developers that are in the process of migrating from Visual Basic 6 to .NET. The transition for them is huge, but ultimately, there are a few issues that rear their heads more than any others. One of these issues is resource acquisition, initialization and cleanup."[_[_ClrMnd -- Matt Kennedy_](]_ > > _Matt showed up in my Referer logs today. We exchanged email and it tuns out that myself and others here have inspired him to start his. Cool! Welcome. Rss-subscribed. [_[_Sam Gentile's Radio Weblog_](]_ > >

I listened to most of Chris Sells on .NET Rocks this morning. It was mostly just interesting chat but the one thing I did pick up that I hadn’t considered before was the idea of putting System.Diagnostics.Debug.Assert(false) in the finaliser for your IDisposable classes. This means that if you’re using a debug build and you forget to call Dispose, you’ll ultimately get an assertion failure to remind you when the GC cleans up. I think this is helpful when moving to the GC paradigm.