[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua Style Guide ?
- From: "Soni L." <fakedme@...>
- Date: Tue, 6 Jun 2017 12:53:22 -0300
On 2017-06-06 11:11 AM, Dirk Laurie wrote:
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).
I mean I guess one could argue for line-feed indentation...
local function x(a)
local function y(b)
Just remember to use a portrait monitor. Benefits include you can still
use the full 80col per line, and you have more vertical space than
horizontal space in portrait mode.
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.