Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-25 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found