It seems that today the most popular operating concept that displaces classical OO is interfaces. For example, well defined interfaces are crucial to automatical glue generation for remote-procedure calls (be they inter processes, or inter hosts).

Classical OO insisted too much on class inheritance. Classic inheritance is an implementation concept that is not relevant to the user of a class. Abstract class inheritance is just a way to specify part of an interface.

To complete interface, reflection allows to dynamically inquire the interface. Interfaces are based on function and method signatures, this is mostly missing from perl5. In that sense, perl5 is hardly an object-oriented language. We have indeed low level interfaces that are defined from the semantic of existing entities (scalar, arrays, hashes..) and formalized in ties. Ties allow to implement complex object and access them thru the syntactical convention designed for the said entities.

What strikes me in Perl5 is this intricacy between low-level entities and specialized distinctive syntax and operators. We say $dict{$a} while in another languguage dict.get(a). It makes the language more difficult to learn and gives it the reputation of being cryptic to the layman. In another language access to these entities would be part of standard classes that would have to be learn anyway and must be accessed thru cumbersome functional interface. This leads to a great expressity that is the main perl specificity. I already wrote about it in patterns, language and syntax

So, no, Perl is not more OO than other languages. And yes, in a sense, it is OO in a very orignal way when it includes in its very syntax the interface of low level entities and permits thru tie to build objects that conform to that interface.

-- stefp please message me to correct my English


In reply to Re: Why perl is more OO than C++ or Java... by stefp
in thread Why perl is more OO than C++ or Java... by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.