lua-users home
lua-l archive

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


On Mon, Dec 6, 2010 at 16:58, Dirk Laurie <dpl@sun.ac.za> wrote:
> On Mon, Dec 06, 2010 at 03:26:13PM +0200, Alexander Gladysh wrote:

>> This is a bad idea. Do not fight against the language. When you write
>> code in Lua, you should think in Lua, not in the language you're
>> comfortable with. Otherwise you'll wind up using a dialect which is
>> not compatible with the rest of the world.

> That is a good general-purpose rule for many things.

> But when something like s[i] can be defined in a few lines of pure
> Lua, as Michal Kottman showed, no C needed, then the fact that an
> idea comes from Pascal does not mean that one is not thinking in Lua.
> "Doing more with less" — that's the idea, isn't it?

The problem is that such things poison your code. Anything that you
write using them you can't reuse outside your immediate context. And
you can't publish your code -- nobody will be able to reuse it without
poisoning their code as well. And if you ever will want to code Lua
for someone else, you'll have to adapt to the proper way of coding in
Lua or to poison their code too.

That's why I'm saying that you're trying to create a dialect, even if
Lua as a language allows such changes.

Alexander.