News for hackers. Stuff that matters.
Re:Three bad things: threads, garbage collection, and nondet... by colomon on Monday August 16, 2010 @10:03PM (#1609980)
I don't see any sign you're telling the author anything he doesn't already know. At least, it looks to me like his complaint is precisely that using and with are awkward solutions, because they break object encapsulation in a particularly ugly way.

Or are you trying to argue that objects should never contain file descriptors or sockets?

Re:Three bad things: threads, garbage collection, and nondet... by jmillikin on Tuesday August 17, 2010 @12:58PM (#1611689)
The author is arguing that reference counting is superiour to garbage collection, because it provides deterministic resource deallocation.

I say this is wrong -- object lifetime and resource deallocation should be entirely separate. He should use with and using(), not depend on a quirk of a particular implementation of the language.

If an object's lifetime ends while it still holds an open handle to a resource, this should be considered a programmer error.