Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

There is OO as a method of encapsulating and associating data and the means to operate on that data, and there is OO as a method of modeling an abstract concept. Both have their place, however I tend to find the latter is actually less useful than the former. The former tends to use 'hasa' or 'containsa' semantics and the latter tends to use 'isa'.

I find programming in an environment that requires isa semantics to be frustrating and annoying (outside of perhaps mix-ins). I tend to find that inheritance and polymorphism to be overused and less useful than is typically advertised, leading to layers of twisty two line subroutines that obscure the actual intent and operation of the code.

On the other hand I find OO as an encapsulation mechansim to be of clear utility, especially in Perl where there are no type declarations. If I build a data structure out of AoAoHoA's and i accidentally feed it to a routine that doesn't operate on that structure the error is neither caught at compile time nor is the error message all that useful, and in fact given autovivification sometimes no error at all occurs, merely incorrect and surprising results. With OO as encapsulation this does problem does not arise, while the error message still will not occur at compile time, an error *will* arise when I call a method on an object that it does not define. Such an error is easy to debug, and is generally preferable to silent erroneous operation.

I think OO is like anything else, used with moderation its fine, used as an end-all-be-all matter of policy is ridiculous.


In reply to Re: The world is not object oriented by demerphq
in thread The world is not object oriented by tilly

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    [planetscape]: boo

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (6)
    As of 2018-04-27 09:38 GMT
    Find Nodes?
      Voting Booth?