lua-users home
lua-l archive

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


On Wed, Jun 22, 2022 at 10:22 AM Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
>
> A question about Lua coding style.
> Is it a good or bad idea to distinguish global from local variables by its uppercase / lowercase initial letter?
> https://stackoverflow.com/questions/72710110/uppercase-or-lowercase-for-global-variables

... as I also use Visual Code for Coding (as your stackoverflow link),
I adapted to this.

The really impressive thing of Visual Code Lua syntax checking is,
that if there are NO such "curly underliners" (blue/yellow/red colour
depending on error "severeness"), then I usually can be quite sure
that my code will be at least "syntactically accepted" by Lua, and
also no severe veriable name errors usually... .

... so (for my really quite small IoT Lua programs (5-10kB Ascii
code)), I am happy to use this "Visual Code" coding style.

Only thing which is a BIT nerving in Visual Code: It will signify the
":" operator as yellow curly error. (e. g. str:sub(1,4) will give
yellow warning, string.sub(str, 1, 4) will be fine).