lua-users home
lua-l archive

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


Let's bring some rationality here :-)

3-space indent is nice with 'if' statements because the condition is
nicely aligned with the first statement after 'then'.

Similarly, 4-space indent is nice with 'for' statements because the
iteration variables align with the first statement in the loop (and
'while' statements would require 6-space indent, etc.).

So the question --far from being some emotional bike shedding issue--
boils down to what is the most used structured statement in Lua.

I contend that the most used and useful statement is 'if'. (in such a
nice language with functional capabilities and tail recursion, we
hardly need anything else - for and while loops are for sissies)

So obviously, 3-space ident is _the_ right way to indent.

In future versions of the language, we could even try to converge
toward 2-letter keywords to benefit more from 3-space indents.
'function' could easily be renamed to 'fn'.  Renaming 'for' to 'fo'
could meet more resistance, but then, this is at such time that we
really need strong BDFLs.

Also, while we are rational types, let's not forget that 3-space
indents are cool, original, and likely to impress girls.

Happy New Year to all of you

Phil

On Sun, Jan 5, 2014 at 12:53 PM, Andrew Starks <andrew.starks@trms.com> wrote:
>
>
> On Sunday, January 5, 2014, Jorge wrote:
>>
>> On 05/01/14 11:51, Hisham wrote:
>>>
>>> I'll just sit in my corner and keep coding my stuff... with three-space
>>> indentation.
>>
>>
>> And i'll represent here the silent majority: whatever the tab key turns
>> into in the editor i'm using a that moment. I don't even know what it is.
>> And i'm NOT going to check it now.
>>
>>
>
> I was ambivalent about spacing. Then one of my colleagues went on a
> hilarious rant about encoding spaces into a text file when tabs can be read,
> just as easily. Now I much prefer that files be encoded with tabs, which the
> author's preference irrelevant (as far as I can tell, anyway).
>
> -Andrew