Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (6)
    As of 2014-08-30 11:32 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (293 votes), past polls