Quote:Original post by Rob Loach
I find I use it mostly when dealing with a large amount of data (through a StreamReader, for example). Don't bother using it for small things as it will just end up making your code unnecessarily messy (remember KISS) and the GC does quite a good job at cleaning up only when needed.
That's a bad suggestion - you haven't understood the difference between disposing resources and having the GC free memory.
You SHOULD ALWAYS call Dispose for an IDisposable object. It has nothing with how good the GC is to do. Implementors of IDisposable are dealing with resources that needs to be released, even though the GC might not need to kick in. For instance you don't want to hold a file open longer than needed. Someone else might need to use that file for instance, but if you haven't called dispose it might in theory be opened as long as your process stays alive.
as Mutex writes, "using" is just a nice way of making sure Dispose gets called. Personally I prefer "using" syntax rather than try/finally even though it gives *exactly* the same MSIL.