[erlang-questions] Controversial subject of the day: tabs and spaces for indentation

Loïc Hoguin <>
Tue Feb 11 00:13:39 CET 2014


On 02/11/2014 12:00 AM, Richard A. O'Keefe wrote:
>
> On 11/02/2014, at 11:12 AM, Loïc Hoguin wrote:
>
>> On 02/10/2014 11:01 PM, Richard A. O'Keefe wrote:
>>>
>>> So remember, it's not "mixed tabs and spaces present
>>> challenges", it's "tabs present challenges".
>>
>> Tabs are perfectly fine for indentation. You had issues only because you were doing both indentation *and* alignment. If you don't align your code, it doesn't matter what the tab length is.
>
> To the limited extent that I understand the distinction you are
> making between "indentation" and "alignment", I don't understand it.
> To me, indentation simply *is* "making some aspect of structure
> directly visible by mapping nesting depth to distance from the
> left margin".

Indentation:

myfunction(A, B, C,
     D, E) ->

Alignment:

myfunction(A, B, C,
            D, E) ->

But also, skipping the indentation that would be to the left of these 
assignments...

No alignment:

A = 1,
Bartender = 17,
Car = 35,

Alignment:

A         = 1,
Bartender = 17,
Car       = 35,

Hopefully it'll show up properly in the email.

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list