Equals Nothing

I'm not trying to spark any type of religious war, but I had to bring this up.  I've been doing a bunch of work recently on the new programming items in ADO.NET Whidbey, including ADO.NET, CLR Objects, SMO, and FullText Search.  I was just reading through some of the new Sql Management Object examples and the examples have the objects being set to Nothing within the Finally block. 

Personally, I have done this for a long time.  I also call .Close() and .Dispose() on objects as much as I can.  I've never had a scalability problem when I have remembered to do this.  I've had a couple of folks with problems, not call Close() and not set to Nothing.  Making the change to .Close(), .Dispose(), and setting the object to Nothing seems to have always resolved the issues they were having.  Now, I see less of a reason to stop.

And how many angels can stand on the head of a pen?

No Comments