In "Re: When to use perl", graff wrote:
Frankly, I don't believe that every piece of code needs to be An Instance of A Class or Object. Lot's of software requirements just don't lend themselves easily to that sort of abstraction, or at least can function quite well without it, thank you.

So... when do you think it's approppriate to use OO? Do you blend procedural programming with OO?

I know I do. I tend to use objects when there is data of which the internals are not too straightforward, and when I need more instances of them at the same time. For CGI, I wouldn't use OO, except when loading multiple form submissions in the same program at once — which very rarely happens.

For example, for a program I wrote, I have a module that splits formatted text into paragraphs, and paragraphs into lines (= where wordwrap occurs) all in order to determine how much screen layout the text takes. The story (= whole text), paragraphs and lines are objects. That came naturally to me. The rest of the program is mostly the standard procedural stuff.

And you?


In reply to When to use OO by bart

Title:
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, details, 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, summary, 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.