‘using’ IDisposable objects

This isn’t fully game related, but I see so many people posting code on forums that looks like this: Stream stream = storageContainer.CreateFile("MyFile.txt"); StreamWriter writer = new StreamWriter(stream); writer.Write("Stuff"); writer.Close(); stream.Close(); I cringe at this sight. IDisposable is an interface that objects leveraging native handles or resources will almost always implement to ensure the native…

17