lua-users home
lua-l archive

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


On Fri, Apr 14, 2017 at 7:34 PM, luciano de souza <luchyanus@gmail.com> wrote:
> With the GOF design patterns, we can assimilate several conceptual
> structures and apply it.
> The problem is that Lua is so different that I am not able to
> understand whats the best practices.

Those patterns still work, except for the ones explicit talking about
statically-typed languages like Java or C++ (Interfaces, Abstract Base
classes, etc).

Lua isn't very different. Like Javascript, it doesn't have a built-in
class system [1], but in a few lines we can create one. (I'm glad that
people like the one in Penlight, which I tried to keep as simple as
possible. Sometimes people ask me to make it do all kinds of strange
things)

Most of the GoF patterns are still applicable.

[1] been playing with Rust, and man does that mess with people's
heads. It doesn't do standard OOP either (it's more Go-ish) and people
get so anxious that they don't have a 'class' keyword and
implementation inheritance and all those other things people learn at
school