Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
It's beautiful. It's simple. It's powerful. It's Perlish.

I can't agree that it's Perlish. Perl was never about minimalism, and the object system is as minimalistic as possible.

There are other indicators for the fact that the object system was bolted on afterwards: You have to know about the representation of objects (blessed references) to create one (compare with strings, where you just write "..." to create one), and the method call, a very common operation in OO code, uses a two-character syntax (compare to string concatenation, which is just one character).

Yes, it's simple. It's also powerful. But not perlish.

Also the fact that methods are just subs in a package is more of a burden than a blessing: it makes introspection of classical Perl 5 OO quite impossible, because you can never know if a sub is intended to be used as a method or a sub.

If you use a module which imports subroutines, they show up as methods in your class when you introspect by looking into the package. Worse, they hide methods of the same name which a superclass might have provided.

(Yes, there are ways to fix that - Moose and namespace::autoclean go long ways to help you with that - but it doesn't feel perlish to me that I have to install modules from CPAN to fix built-in behavior. It's just perlish that it's possible at all :-) ).

Perl 6 - links to (nearly) everything that is Perl 6.

In reply to Re: In praise of Perl's object system. by moritz
in thread In praise of Perl's object system. by DStaal

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 taking refuge in the Monastery: (4)
As of 2024-04-23 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found