One of the major problems with Perl's OO, is something I haven't seen
mentioned in these lists, until now. So I'll bring it to your attention
here and now.

The problem is that you can't safely subclass a class, without examining
it's source, just to make sure that your instance fields don't clash
with any private fields of the mother class. We need some mechanism to
keep private fields private.

Just let me point you at a newsgroup post by Abigail who put it pretty
eloquently:

   <http://x63.deja.com/[ST_rn=ps]/getdoc.xp?AN=551766651>


   Perl OO violates the basic reason OO exists: implementation hiding. 
  
   And yes, am I aware that after 5+ years we got hacks like %FIELDS,
   base.pm, pseudo-hashes, and Tom and Damian have collected assorted
   tricks in man pages and books. But tricks are nothing more than
   tricks. I still cannot take a random module from CPAN, study no more
   than its interface, subclass it, and be garanteed it works. I would
   still have to study the internals to make sure it works; and if it
   doesn't use a myriad of tricks, but just "normal OO" (that is,
   objects as a hashref), any update of the module could break my
   subclass, even if it isn't changing the interface. 
  
   Perl OO is nothing more than a mockup thrown together to make Perl
   look modern language. It's a facade, making Java look like an
   attractive language. Perl is a toy language, and as long as it has
   this form of OO, it'll remain a toy language.
 
And, in a follow-up post:

    I detest Perl OO because it's neither OO, *NOR* Perl.

-- 
        Bart.

Reply via email to