[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Upstream is not the last word (was Re: [ANN] Lua 5.1.5 (rc1) now available)
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 14 Feb 2012 11:29:32 +0200
On Tue, Feb 14, 2012 at 10:39 AM, Sean Conner <email@example.com> wrote:
> ... Also, I'm not a big proponent of object
> oriented programming, and I find what Lua provides just fine for my own
> needs (I stay as far away from C++ as possible), so I don't quite understand
> this whole obsession over objects.
Well, twenty years of OOP has ingrained a way of thinking about
problems and enshrined it as the Way. It's still a fine way to
organize solutions to some common problems. It would obviously be bad
if the language enforced it, but (fortunately) that's not going to
Newcomers would be more comfortable if there was a straightforward
pre-packaged way of making classes; the trouble comes when they see
something like LOOP and run screaming to the comforts of their
favourite OOP scripting language. Experienced developers have another
problem, which is that they cannot share more than the assurance that
duck:quack() works. (We can't even assume that getmetatable(duck)
represents a Duck 'class' and that's a feature, not a bug )
So (like Jay) says: keep it really simple. Encourage newcomers to use
a little library if they feel the urge to make class hierarchies, even
if it just contains the mt.__index = mt incantation.
 This powerful urge results in derivative languages which provide
MoonScript for Lua.
 Some people enjoy saying duck.quack(), and Lua can satisfy them,
at the cost of confusing everyone else and creating an unbounded
number of closures.
 Similar cognitive dissonance happens with people new to Go, which
basically does compile-time duck typing.