Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 2
    I agree that RAII is the bees knees. But the using clause is a great step forward for C# over Java. It does allow deterministic destruction and thus correct resource management (its not quite as good as RAII as you need to remember to do it, but its definitely a good idea). Commented Nov 7, 2011 at 17:58
  • 8
    “When it comes to closing files in Java, it's malloc() and free() over there.” – Absolutely. Commented Nov 7, 2011 at 17:59
  • 9
    @KonradRudolph: It is worse than malloc and free. At least in C you don't have exceptions. Commented Nov 7, 2011 at 18:52
  • 1
    @Nemanja: Let's be fair, you can free() in the finally. Commented Nov 7, 2011 at 19:10
  • 4
    @Loki: The base class problem is much more important as a problem. For example, the original IEnumerable didn't inherit from IDisposable, and there were a bunch of special iterators which could never be implemented as a result. Commented Nov 7, 2011 at 19:10