lua-users home
lua-l archive

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

On Tue, 18 Jan 2022 at 14:53, Flyer31 Test <> wrote:
> I am quite new to Lua, but I think at least for beginners, it is nice
> and reasonable that Lua skips all these "typical C abbreviations" ++,
> --, +=, -=, *=, ...  . Too many operators I think are not helpful,
> especially not for a skript language which should be "learnt easily".

Beginners can easily skip them but, leaving the increment operators
apart, I've found sometimes the op-assign variants are much easier to
explain to complete beginners.

I mean, I routinely says "double the height", "Incement balance by
amount", which are much easier to parse as height*=2 and
balance+=amount. The notation height=height*2 is one of the things
whish is somehow hard to teach to beginners, especially those familiar
with math notation. I think that languages which use := and = instead
of = / ==, or even some which use other notations are easier for the
absolute beginners.

Of course many of this operations come from native machine code ops,
but even there the Z80 style off ADD A,B is easy to read.

In my opinion those not only save typing, they clarify code. And I miss them.

Francisco Olarte.