Hacker News new | ask | show | jobs
by moron4hire 4665 days ago
A class implementing IDisposable is that documentation. You shouldn't need more documentation than the fact that IDisposable is there.
1 comments

An annoying fly in this ointment is cases where objects assume the responsibility for calling Dispose on caller-provided disposable objects. While it should always be okay to "double-dispose", this is only a guideline, and can't be enforced by the language, so, to maximize future compatibility with classes outside your control, you should probably defensively avoid calling Dispose on an object that will have already been disposed by other means.