Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: Re: The world is not object oriented

by tilly (Archbishop)
on Jan 04, 2004 at 00:13 UTC ( [id://318563]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: The world is not object oriented
in thread The world is not object oriented

I don't think that we are going to come to agreement on whether closures are objects. Of course you can shoehorn your understanding of closures into an OO framework. But that isn't a useful view because it seriously misleads you about how to actually make effective use of them.

If I was going to put this as a linguistic metaphor, I'd say that objects make good nouns and closures make good verbs. You think about them completely differently, and you evolve designs with them differently as well. With objects you think about pieces that need to communicate with each other. With closures you evolve behaviours.

But that is rather vague. Read Why I like functional programming, Re (tilly) 1 (perl): What Happened...(perils of porting from c) and Re (tilly) 1: 5x5 Puzzle to get an idea of how I use closures in practice. If you don't get a sense from that code that manipulating closures "feels different" than OO design, then I really don't have any idea how to communicate the mindset shift involved.

Replies are listed 'Best First'.
Re^5: The world is not object oriented
by hardburn (Abbot) on Jan 05, 2004 at 01:08 UTC

    I don't think that we are going to come to agreement on whether closures are objects.

    No, probably not.

    I don't think I really made this point very well above (which is my fault), but it's not that I put an absolute stamp on closures as objects. Rather, I think they can be used as a limited form of object, but they're not limited to OO, either.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    : () { :|:& };:

    Note: All code is untested, unless otherwise stated

      ...it's not that I put an absolute stamp on closures as objects. Rather, I think they can be used as a limited form of object, but they're not limited to OO, either.

      Imagining this as a Venn diagram, what then, I wonder, would be an appropriate name for the field of endeavor and design that exists in the intersection?

      (I need to know so I can complete my OO model of OO-ish concepts...;)

      Matt

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://318563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-03-29 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found