http://www.perlmonks.org?node_id=605131


in reply to RFR: Inside-out classes - a Class::InsideOut primer

Your introduction on Inside-Out Objects insn't right. You seem mostly concerned with preventing people from bypassing the API and muck directly with the internals. But this is Perl, mucking with internals is allowed, though frowned upon. After all, isn't a common catchphrase for Perl not "stay out of my livingroom because it's the polite thing to do, not because I have a shotgun"?

But the main reason for wanting them is one you don't mention, and it's not such an "esotheric" one as you claim: it is in order to be allowed to subclass any class without having to be aware of any hidden fields that are stored in the parent class, without any risk of trampling all over them, of which, after all, the list may change (grow) over time.

Compared to this, the direct field access and the possibility of mistyping are just minor issues.