Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Is it possible to meld OO and functional programming together? I mean more than just having closures as your attribute values, but really meld the two? Or, for that matter, meld OO and declarative or functional and declarative?

I'm asking the question because it's unclear to me if the various styles are blendable or not. And, this meditation just puts it into perspective for me.

My personal style is to use objects as the gross organizer, but to use a curious blend of procedural and functional within the methods of those objects. I use inheritance as a gross form of reuse and interface enforcement. (Except, of course, when I use it for other things.) And, declarative is used whenever I drop into SQL. Except, I build those declarative statements using that curious blend of OO, functional, and procedural.

Speaking of functional ... functional has always seemed, to me, to be more about data than OO is. Functional builds functions from functions, but that's just so you can process lists. The lists are what actually go through the functions-of-functions. So, in a way, functional programming is the style of programming most closely tied to the data-flow diagram. Everything just flows, like the Mississippi delta, at its own pace. Kinda like the Sixties.

OO, on the other hand, is much more like urban life. Everyone distrusts everyone, doesn't allow anyone to peek inside the windows, and everything has a contract. If you violate the contract, you're taken out back and shot like the dog you are.

Declarative, to me, has always seemed to be the style of programming that Louis XIV or Henry VIII would have used. "Give me THIS, and be snappy about it!" No if, ands, or buts.

Procedural is what you do when you're speaking to an 8 yr. old who just couldn't care about what you're asking, but he'll still do it. You just have to be really specific. It's not enough to say "Clean your room." You have to say "Pick up the stuff on your floor, organize your desk, make your bed, and fold your clothes". Even then, you'll miss something.

We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

In reply to Re: The world is not object oriented by dragonchild
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
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (3)
    As of 2018-04-21 07:02 GMT
    Find Nodes?
      Voting Booth?