4 ms·
This is Go, yet add again, catching up to the lessons learned by the other programming language communities. As you point out, finalizers are no longer in good
by pjmlp 2y ago
This is Go, yet add again, catching up to the lessons learned by the other programming language communities.
As you point out, finalizers are no longer in good grace in Java, not even in .NET, but lets leave that for another thread.
Hence why they are deprecated since Java 9, released in 2017, and a Cleaner queue should be used instead, or try-with-resources.
https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html#finalize https://docs.oracle.com/javase/9/docs/api/java/lang/Object.h...
Basically runtime.AddCleanup() is the Go's version of java.lang.ref.Cleaner::register().
- pigeonhole123 2y agoIt would be better if they didn't learn from the others
- Cthulhu_ 2y agoCan you explain? Because if you don't learn from others you're cursed to repeat the same mistakes. I like to mention Java's generics implementation making up half the language spec and compiler.
- anacrolix 2y ago"We're special. Hmm, okay that didn't work". Every Go feature.