3 ms·
I would argue that the opposite is true, because memory is fungible and files are not. c.f.) Java, where the GC can handle memory, but it didn’t work out so we
by bunderbunder 4y ago
I would argue that the opposite is true, because memory is fungible and files are not.
c.f.) Java, where the GC can handle memory, but it didn’t work out so well for files, so, to restore correctness, we needed the Closeable and AutoCloseable interfaces to give manual control back to the programmers.
- yakubin 4y agoClosing a file doesn't trigger a cascade of closing other files, while freeing memory in RAII does trigger a cascade of more frees.