Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Exactly!

Perhaps even worse, in my experience (though it took quite a while for me to fully understand how these problems were being encouraged by the same practice), the focus on accessor generation and constructors that expose attributes (and for adding other functionality with a focus on decorating accessors with before/after/around wrappers) leads to OO design that is focused on attributes first, inheritance second, and interfaces a very distant third. This leads to designs that scale over time much less well (based on my experience with quite a few concrete such designs over multi-year lifespans).

The correct priority to use when doing OO design is interface first, attributes a distant second, and inheritance not at all.

Your new best practices need to refine your old best practices not thwart them. Don't adopt OO practices that go against the more basic best practice of encapsulation (narrow interfaces, data hiding).

Also, data types are of profound importance if you are stuck programming with interfaces using positional parameters. But they quite suck in many ways if you aren't stuck in that way. But I think I'll skip the long rant on that part of the topic at this time.

- tye        


In reply to Re^8: The future of Perl? (encapsulation) by tye
in thread The future of Perl? by BrowserUk

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 browsing the Monastery: (6)
As of 2024-04-19 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found