[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Style Guide ?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 6 Jun 2017 16:11:52 +0200
2017-06-06 15:25 GMT+02:00 Marc Balmer <email@example.com>:
> Tabs are holy. Spaces, no matter how many, are just a cheap substitute.
> Any yes, any line shall never exceed 80 characters, that's the eleventh
WIth great respect to all those who are gleefully enjoying the direction
this thread is going, a quotation from the Bible :
Whitespace of whitespaces, saith the Programmer; all is whitespace.
After all, Lua is whitespace-agnostic; you can just pass your chunk
of code to quite a simple reformatter .
Style is much more than that.
It deals with questions such as:
- Do you explicitly code 'nil' in situations where it will be supplied
- Do you write "y=10*x" or "y=10.0*x" when you know that x is
- Do you monkeypatch globals?
- Do you use closures to encapsulate upvalues?
 Modern Geek Version.
 Any idiot can write one. My first Lua program (part of my LuaTeX
primer) was just such a reformatter.
 Not necessarily a good one. My first Lua program can't reformat
itself (failure to take into account the "--[^\n]*\n" comment construction).