lua-users home
lua-l archive

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

On Monday 31 January 2011 07:46:13 Enrico Colombini wrote:
> On 31/01/2011 13.33, steve donovan wrote:
> > After all, it's such fun to do our own; sometimes I think this was a
> > lost opportunity.  A straightforward metatable-based OOP scheme is
> > maybe a hundred lines of code, which hides the 'uncomfortable' stuff
> > and puts it behind a 'standard' facade.  If such a little module were
> > included in the Lua 5.1 distribution (like strict.lua) then perhaps we
> > would not have such fragmentation.
> Probably not, but there could be a cost: people would start building
> around this 'standard' OO and pretty soon our beautiful swiss-army knife
> of a language could feel cast in concrete and become as unwieldy as,
> say, Java.
> Besides, not everyone needs formal OO (I can usually live without it,
> for example), so I'd keep such code neither in the distribution nor in a
> standard library (where it could do great damage by imposing an
> 'ideological' view), but in an external add-on library. Just as Unicode
> strings, sockets and other features that can be invaluable to somebody
> and useless to others.


Lua's best gifts have little to do with OOP. If I were going to choose a 
language with which to do OOP all the time, Java or Ruby would be perfect. But 
good OOP is only a small part of what I want out of a language, and the 
tables-centricity and functions-are-data-centricity provide me a much better 
programming experience than pure OOP would ever provide.

You know what else? Personally I think OOP is close but no cigar. I'm a 
believer in "It's the data stupid!" My belief is that if you get your data 
structures to match the problem domain, programming becomes much easier and 
much higher quality. Truth be told, I view OOP as a data structure boxed up 
with the subroutines necessary to work those data structures. When it comes to 
data structures, I think Lua leads the field.


Steve Litt
Recession Relief Package