lua-users home
lua-l archive

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


Am 03.11.2017 um 07:45 schrieb Andreas Weis:
The semicolon question is a difficult one. While Lua programmers like to omit them, many folks coming from C-like languages seem to want to write them (at least during an initial transitioning period). I decided to keep them on the slides here, but I do agree that it's not idiomatic Lua style.

<JUSTMYTWOCENTS>
(I did not start this discussion before,because i dont want to start a
not ending discussion:
I write semicolons EVERYWHERE i can, because it helps me reading and
understanding the code; If i try to use a free module from the web, I
crerate a test case and step throu the modules functions. I try to
understand what the module does. Within this proces i reformat the
indentation and the line breaks.

I like lua because it is like it is, BUT the one and only not well
defined feature of this language is the statement delimitter. From my
point of view omitting the semicolons is without any benefit except
honoring the lazyness of the programmer. A few days ago i came over
something like the following code lines:

  func(blabla)
  ;(higgs or superman)(donald)
  morefuncs()

looks strange to me. I reformatted the code sequence this way:

  func(blabla);
  (higgs or superman)(donald);
  morefuncs();

Many authors of free software spending a lot of effort into writing a
good documentation so others can easily understand there modules. And
then they make it harder to understand by different indentations styles
and omitting semicolons like in my example before.

</JUSTMYTWOCENTS>