[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Luajit and curstom data structures
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 15 Apr 2011 13:46:12 +0200
On Fri, Apr 15, 2011 at 1:32 PM, H. Diedrich <hd2010@eonblast.com> wrote:
> Coming from C++ you'll see some
> of the safety but also lots of clutter from the hard types flying off. That
> to my experience, needs a little stretching to allow oneself to put the
> liberty to task. But Lua absolutely deserves to try to free your mind from
> what you know, with an effort, which is harder because it looks so similar.
This is very true, treat it first as a new game, and come back to the
old OOP strategies when they make sense. In particular, the whole
idea of _closures_ (especially anonymous ones) is so liberating. A
common pattern in modern C++ is to use 'functors', objects which are
callable, because classes are The Way to encapsulate state; a closure
can often do the job much more cleanly.
That being said, if I had some objects which were Drawable, I would
use OOP-like thinking, but would only bother to define a Drawable
common base class if these objects did indeed need to share some
common implementation.
steve d.
- References:
- Luajit and curstom data structures, KR
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, KR
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, Dimiter "malkia" Stanev
- Re: Luajit and curstom data structures, Michael Gogins
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, Michael Gogins
- Re: Luajit and curstom data structures, Mike Pall
- Re: Luajit and curstom data structures, KR
- Re: Luajit and curstom data structures, H. Diedrich