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

Garrett Smith g@REDACTED
Wed Feb 5 21:28:24 CET 2014


On Wed, Feb 5, 2014 at 2:21 PM, kraythe . <kraythe@REDACTED> wrote:
> Actually the solution to this age old debate was proposed to me by a friend
> of mine and its genius on a number of levels but isn't implemented anywhere.
> The reality is that for most languages whitespace is irrelevant so it
> shouldn't be the code holding the indentation but the user's preference
> file. Imagine a source code repository where there is NO irrelevant
> whitespace in the code base. For java, for example, there would be literally
> only one single line of code. Now when you check out you have a preference
> file that says you want tabs or spaces or mixed and also defines the other
> formatting you prefer. When you check out the system reformats the code
> according to your specs dynamically. When you commit, it strips your code of
> whitespace before comparing.
>
> Now that would rock. Not just for tabs but the other code holy wars like
> drop braces and so onl

Heh, not bad. I wonder how something like this might evolve.

Garrett



More information about the erlang-questions mailing list