From: Ralph Shnelvar Date: 2009-11-30T06:08:51+09:00 Subject: Re: Class variables, instance variables, singleton; Ruby v. DM> On Saturday 28 November 2009 02:42:08 pm Ralph Shnelvar wrote: >> DM> It won't tell you how many Foo objects actually exist. It's more a >> count of DM> how many have ever been created. >> >> Cool. >> >> Is there a way to tell how many instances actually exist? Is there >> anything like a destructor for class instances? Just curious. DM> These are separate questions. [snip] DM> I suppose that's the fundamental difference -- in Java and C++, encapsulation DM> can be enforced to some extent, while in Ruby, it can be easily circumvented. DM> But Ruby makes it easy to write well-encapsulated code, while Java and C++ DM> make it annoying and tedious. Oh, wow, what a great explanation! Thanks for taking the time. Wow.