<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">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. </span><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">Now that would rock. Not just for tabs but the other code holy wars like drop braces and so onl </div></div><div class="gmail_extra"><br clear="all"><div>
<div dir="ltr"><div style="font-family:arial;font-size:small"><b>Robert Simmons Jr. MSc. - Lead Java Architect @ EA</b></div><div style="font-family:arial;font-size:small"><i>Author of: Hardcore Java (2003) and Maintainable Java (2012)</i></div>
<div><i style="font-family:arial;font-size:small">LinkedIn: </i><font face="arial"><i><a href="http://www.linkedin.com/pub/robert-simmons/40/852/a39" target="_blank">http://www.linkedin.com/pub/robert-simmons/40/852/a39</a></i></font></div>
</div></div>
<br><br><div class="gmail_quote">On Wed, Feb 5, 2014 at 2:21 PM, kraythe . <span dir="ltr"><<a href="mailto:kraythe@gmail.com" target="_blank">kraythe@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">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. <div>
<br></div><div>Now that would rock. Not just for tabs but the other code holy wars like drop braces and so onl </div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div style="font-family:arial;font-size:small">
<b>Robert Simmons Jr. MSc. - Lead Java Architect @ EA</b></div><div style="font-family:arial;font-size:small"><i>Author of: Hardcore Java (2003) and Maintainable Java (2012)</i></div><div><i style="font-family:arial;font-size:small">LinkedIn: </i><font face="arial"><i><a href="http://www.linkedin.com/pub/robert-simmons/40/852/a39" target="_blank">http://www.linkedin.com/pub/robert-simmons/40/852/a39</a></i></font></div>
</div></div><div><div class="h5">
<br><br><div class="gmail_quote">On Wed, Feb 5, 2014 at 1:33 PM, Vlad Dumitrescu <span dir="ltr"><<a href="mailto:vladdu55@gmail.com" target="_blank">vladdu55@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Wed, Feb 5, 2014 at 8:27 PM, Garrett Smith <<a href="mailto:g@rre.tt" target="_blank">g@rre.tt</a>> wrote:<br>
> On Wed, Feb 5, 2014 at 1:24 PM, Vlad Dumitrescu <<a href="mailto:vladdu55@gmail.com" target="_blank">vladdu55@gmail.com</a>> wrote:<br>
>> On Wed, Feb 5, 2014 at 8:18 PM, Garrett Smith <<a href="mailto:g@rre.tt" target="_blank">g@rre.tt</a>> wrote:<br>
>>> It seems to me that this problem is easily solved by inverting the interests:<br>
>>> - Fix erlang-mode to default to all spaces<br>
>>> - OTP team includes the appropriate Emacs code headers in the source<br>
>>> files (or the dot file in the source root directory as Magnus just<br>
>>> pointed out) and leave them horribly formatted, per their preference<br>
>>><br>
>>> Does this not trivially solve the world's Erlang indent problems?<br>
>><br>
>> Unfortunately, no. If I make a patch without emacs, my editor will<br>
>> still use something else than a mix of tabs and spaces, so it will<br>
>> have to be OTP-ified by hand (copying indentation from other lines) or<br>
>> by running it through emacs just for that.<br>
>><br>
>> Which, in a funny turn of events, brings me to a question related to<br>
>> the previous "holy war": can emacs open, reindent and save files in<br>
>> bach mode? That would indeed help! (even if one would still have to<br>
>> install emacs).<br>
><br>
> This seems like a problem that can be confined to the OTP team and<br>
> process, which is I think is a pretty small subset of all erlang-mode<br>
> users, no? And changing erlang-mode to default to spaces doesn't make<br>
> this worse does it?<br>
<br>
</div>You are right, it's better like you suggested and definitely a step in<br>
the right direction. But I think that most Erlang projects are more<br>
lenient regarding whitespace mismatches in patches (being much<br>
smaller) and thus the project where it hurts the most to be<br>
non-compliant is not going to be affected. Yet.<br>
<span><font color="#888888"><br>
/Vlad<br>
</font></span><div><div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>