[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua strictlessness
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 27 Aug 2013 09:27:49 +0200
2013/8/27 Sven Olsen <sven2718@gmail.com>:
> Enforcing naming discipline on locals is a mostly unrelated topic -- and
> most examples of local shadowing will happen inside nested blocks, a
> situation where they're not, actually, likely to be a source of memory
> inefficiencies.
Enforcing discipline of whatever kind is the category of often-suggested
Lua "enhancements" that I hate most.
The only good discipline is self-discipline.
Anybody who does enough programming acquires certain habits willy-nilly,
and it's not a bad idea to acquire some good ones consciously.
For example, currently I put my entire file in one huge do-block. The
locals I declare at the top of that block feel like globals, but actually
are upvalues. In general, I declare locals only directly after 'do', 'then' and
'function', except when there is a cogent reason to transgress: then
I comment that exception.
I'm not saying you should do exactly these too, merely that they represent
a conscious attempt at forming some good habits.
- References:
- Lua strictlessness, Rafis DoctorInfo
- Re: Lua strictlessness, Leo Razoumov
- Re: Lua strictlessness, Rafis DoctorInfo
- Re: Lua strictlessness, Leo Razoumov
- Re: Lua strictlessness, Tangent 128
- Re: Lua strictlessness, Tim Hill
- RE: Lua strictlessness, Thijs Schreijer
- Re: Lua strictlessness, Rafis DoctorInfo
- Re: Lua strictlessness, Coda Highland
- Re: Lua strictlessness, steve donovan
- Re: Lua strictlessness, Sven Olsen
- Re: Lua strictlessness, Tim Hill
- Re: Lua strictlessness, Andrew Starks
- Re: Lua strictlessness, Tim Hill
- Re: Lua strictlessness, Sven Olsen