03-28-2015, 10:22 PM
why should he care about unmanaged objects?
I dont understand what u trying to explain

If its about memory then its useless because there is a GC that destroys the not used objects.(Only if there is no reference to it)
because the garbage collector does not clean/release unmanaged objects. He does take care of managed resources (most of the resources you will use are managed).
You have to take care of unmanaged resources for example via the Dispose pattern because the GC "does not know how to release and clean the unmanaged resource" but is able to track the lifetime of it.
Read my post carefully again. I just added a side note how to implement that pattern if he is planning to work with unmanaged resources but my main purpose was to tell him that there is no need to call reader.Close() at all because the using statement calls the Dispose() method and does that internally.
In my oppinion it's allways good to know how things work and what actualy the using() directive does. This was an explanation.

