On Thu, Feb 2, 2012 at 2:30 AM, Tom Christiansen <tchrist@perl.com> wrote: > It's that you cannot guarantee that destructors are *ever* called > in Java — nor, now because of J(ava-P)ython, in Python either. > That means you cannot hope to have a destructor duly called to > free up a non-memory resource. They might never happen at all, > and in fact, in most JVM implementations, never do get called > at all in the normal course of running. At all, I said. Scary. > > It's a very different resource-management (non-)strategy than > we're accustomed to in Perl, where the only non-determinism I'm > aware of with destructors is their order of firing when several > logically achieve a refcount of 0 "simultaneously". This is also known as Resource Acquisition Is Initialization, which is the poorest name for a programming pattern ever. LeonThread Previous | Thread Next