Problem Statement
Why is finalization discouraged and what’s the modern alternative?
Explanation
Finalizers run at GC’s discretion and can cause leaks or latency spikes. Use explicit close patterns or Cleaner for safety and determinism.
Practice Sets
This question appears in the following practice sets:
