[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua style guide ?
- From: Martin <eden_martin_fuhrspam@...>
- Date: Mon, 12 Jun 2017 10:43:48 -0700
On 06/09/2017 11:37 PM, Hisham wrote:
> On 10 June 2017 at 03:02, Sean Conner <sean@conman.org> wrote:
>>
>> It was thus said that the Great Dirk Laurie once stated:
>>> 4. Do we make big do ... end blocks in our code in order to
>>> restrict the scope of locals?
>>
>> I do that quite often. In fact, I'll do things like:
>>
>> local somevar do
>> -- code to do a bunch of stuff
>> somevar = ...
>> end
>>
>> to make it clear that there is some non-trivial initialization of a local
>> variable.
>
> [...] above example with odd indentation [...]
Concerning odd indentation. I've found nice ninja indentation trick in
one of World of Warcraft addon:
if <cond> then do
end
[many_lines_of code]
...
end
For someone not closely familiar with Lua syntax it appears that
[many_lines_of_code] logic belongs to main branch, not "if".
-- Martin
- References:
- Re: Lua style guide ?, Roland Yonaba
- Re: Lua style guide ?, Russell Haley
- Re: Lua style guide ?, Peter Aronoff
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Edu Araújo
- Re: Lua style guide ?, Sean Conner
- Re: Lua style guide ?, steve donovan
- Re: Lua style guide ?, Dirk Laurie
- Re: Lua style guide ?, Hisham
- Re: Lua style guide ?, Dirk Laurie
- Re: Lua style guide ?, Sean Conner
- Re: Lua style guide ?, Hisham