Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

comment on

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

Echoing BrowserUK’s comments, and after up-voting his post, I would emphasize that a running, stable application is a very important thing not to be changed lightly.   In my experience it is best to add objects to existing applications, when and where and if that makes sense, and to generally let a sleeping dog lie.

Perl’s implementation of objects is just as pragmatic as the rest of the language.   A constructor routine, with a by-convention choice of name, that returns a blessed (hash...) reference; a fast-and-efficient notion of “blessed,” and the blessed-reference is always the implied first parameter to the function.   This gets the job done simply and efficiently without compelling you to seriously change either your thinking or your code.   (Typical battle-tested Perl wisdom ...)

Yes, the object paradigm (in Perl) is quite useful, because it gives you “a convenient briefcase in which to store your coat,” or anything and everything else that you need to carry around with you, and it makes sure that you won’t misplace it.   Plus, a naturally-simplified calling convention for the clients to use.   Yes, lots of formerly-function based packages did “convert” to an object API, but then again, I daresay that there are other packages that went the other way.   They didn’t do it because someone just felt embarrassed about how the package worked before.

“Best Practice” is, and forever will be, a general guideline ... a frequently-beneficial categorical suggestion, but made by someone who does not know and cannot know your application’s unique situation.   But I would not tamper with what works, just because of it.   Rather, I would permit my application to evolve naturally, trending in this new direction as it makes logical business-sense to do so.

In reply to Re: module w/ object-oriented and functional interfaces: best practices? by sundialsvc4
in thread module w/ object-oriented and functional interfaces: best practices? by temporal

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
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (5)
    As of 2019-12-11 05:06 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found