← Back to context

Comment by jayd16

1 year ago

Is this right? Don't languages clean up resources in finalizers? (It's just often not ideal because finalizer calling is not predictable... Or really that they are by default called by memory pressure and not resource pressure).

You've clearly never coded in C/C++ where it's your job as the coder to manage memory and other resources.

  • I'm confused. Are your comments only relevant to C/C++ when the thread is about Go and the question was what any language should do? Personally I was thinking about garbage collected finalizers such as in Java.

    • No.. Go did a half-assed version of reference counting on resources. Memory yes. File descriptors, no so much.

      Edited to add: What's the point of continuing to discuss this if all you understand is .NET and not actually tried to manage C/C++ resources (without using boost smart pointers) by hand?

      1 reply →