lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Dibyendu Majumdar once stated:
> On 13 July 2017 at 14:27, steve donovan <steve.j.donovan@gmail.com> wrote:
> > On Thu, Jul 13, 2017 at 3:21 PM, Javier Guerra Giraldez
> > <javier@guerrag.com> wrote:
> >> but a rather big checkbox in enterprisey decision making
> >
> > Which is a pity, since people who have learned it seem to be forever
> > stuck like flies in amber.
> >
> 
> Actually OO is essential tool for organizing large code bases. I am
> not talking about inheritance and all - but just the ability to
> organize your code into objects of different types. Remember objects
> carry state.

  OO is good when you have a large number of nouns (data types) and a few
verbs (actions upon said data).  Reverse the situation, and normal
imperative programming is easier.

  Also, we all misunderstood Alan Kay when he popularized OO [1].  Then
again, he *misunderstood* himself [2] so it's understandable if we all
missed the point of OO.  It's not objects---it's small programs that respond
to messages.  Basically, message based programming.

> I find that even with Lua, when I am exposing an API - I need to make
> it OO for the user else user has to manage state and call functions
> with potentially large number of arguments which just doesn't make
> sense.

  You know that objects are just a poor man's closure, right? [4]

  -spc (But a closure is just a poor man's object ... )

[1]	He didn't invent it---that was primarily the developers of Simula.

[2]	And is still yelling at us for not reading his mind [3].

[3]	Yes, I'm in a cynical frame of mind today.

[4]	http://wiki.c2.com/?ClosuresAndObjectsAreEquivalent