lua-users home
lua-l archive

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

On Sunday, February 23, 2014, Journeyer J. Joh <> wrote:
Hi Thijs Schreijer,

OK, Let me consider LOOP also.

I am not an expert only I have basic concepts without may experiences.
I want to make experiences with Lua.

Thank you very much for your concern.

Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m

2014-02-23 23:27 GMT+09:00 Thijs Schreijer <>:
Whether to use LOOP or not; I assumed you are familiar with general OO concepts already, just not in Lua. If so, LOOP is ok to use. But if this is your first foray into OO, then Steve is right and it will only be confusing. 


-------- Oorspronkelijk bericht --------
Van: steve donovan
Datum:23-02-2014 09:45 (GMT+01:00)
Aan: Lua mailing list
Onderwerp: Re: How can I learn about Object Oriented programming with lua?

On Sun, Feb 23, 2014 at 10:11 AM, Thijs Schreijer
<> wrote:
> Lua provides the means to do OO, but that also means that you can do it in many different ways. (have a look at LOOP, which implements a bunch of them)

Which is exactly why I don't think LOOP is good for beginner; it's
best to understand one scheme well and use it consistently.  Otherwise
it is premature optimization.

My (biased) opinion - has reference to Lua wiki article:

> Understand the table as being the core of an object
> Understand __index metamethod

With this I totally agree. - that's the essence.  It can be confusing,
because we often set the 'class' table __index to point at the class
table itself.  This is convenient, but not necessary;  important thing
to understand is that putting methods into a table's metatable does
not automatically make them available.

> Understand difference between 'fat' inheritance (copying all members of a class into a new table), versus 'dynamic' using the __index metamethod (a change to an ancestor might change all descendants)

Not crucial to using OOP in Lua; it's an implementation strategy. I
like 'fat' inheritance because there are no long chains of lookup for
deep class hierarchies, and it's all self-contained.

steve d.

Just wanted. Throw in that I'm a huge fan of Design Patterns. I didn't go to college, but one of our devs was good enough to let me read all of his books. This was my favorite of his bunch. 

I also learned a tremendous amount from Head First C. It was entertaining but also packed with great information. It didn't cover all of C, but it did teach some excellent life lessons along the way. 

We have a non-profit, engineering playground called Leonardo's Basement. My goal is to teach programming by starting with Head First C, replacing its last project with something involving the Lua C API and then to teach Lua in the second half of the class. 

Done well, it seems as though that would be an excellent way to teach programming to the "truly interested" child. My remaining obsticals are to learn how to teach well and time. :)