Are you a superior 4-spacer or is that too much for your weak IDE on that 4:3 screen?
The Tabs vs. Spaces war is over, and spaces have emerged victorious
41–50 of 238 posts
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#42Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#43Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#44The choice isn't (tabs) vs (spaces). It's (tabs && spaces) vs (spaces). In the real world, there will always be spaces, whether used for indentation or not. Using tabs for indentation inevitably leads to a mix of both - which is, objectively, worse for maintenance and consistency.
[TAB][TAB][TAB]ShortTypename[SPACE][SPACE]variable_name
[TAB][TAB][TAB]LongLongLongTypename[SPACE]variable_name2
ps. the [SPACE] counts above are illustrative, not accurate.
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#45Tabs are the modern choice, because you can then configure your editor so that for every tab character, it calls an LLM with the buffer contents up to that point, with instructions to generate an appropriate number of spaces that can then be substituted in. You might be thinking 2, 4, or 8, but the LLM will give you the contextually-correct answer.
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#46Rob Pike on why Go is indented with tabs [0]: > How wide should the indentation be? 2 spaces? 4? 8? Something else? > By making the indent be a tab, you get to decide the answer to that question and everyone will see code indented as wide (or not) as they prefer. > In short, this is what the tab character is for. 0: https://groups.google.com/g/golang-nuts/c/iHGLTFalb54/m/zqMo...
Exactly. Indentation != spacing. And thats all the argument i need. I dont understand why people argue with consistent text layout for all-spaces. You can use tabs to indent and spaces to align after that, in most cases.
In practice this is difficult; since the characters are invisible by default, people will inevitably mix up the two. Looks like the industry standard is to give up and use spaces everywhere, unless strict and mandatory tooling exists.
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#47Earlier quoted context omitted.
This works until someone tries to vertically align something like a table or a line that is wrapped.
Yes, this. Which the counter point is either, Don't align things, or use tabs for indentation, and spaces for alignment. And maybe you can enforce no alignment, but that's a hard fight to win. And as far as tabs for indentation and spaces for alignment, I've found no practical way to enforce this via tooling/linting. And a rule without enforcement becomes inconsistent, which is how we get files full of mixtures of sp…
Addind a comment with the right amount of tabs as a table header and align all fields with spaces after the tabs would do the trick.
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#48Just define Tab as 1 space, and they can be used interchangeably. Peace in our time.
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#49Earlier quoted context omitted.
tabs for indentation, spaces for alignment
Meanwhile, I'm trying to get away from languages where whitespace has semantics.
Re: The Tabs vs. Spaces war is over, and spaces have emerged victorious
#50Earlier quoted context omitted.
Exactly. Indentation != spacing. And thats all the argument i need. I dont understand why people argue with consistent text layout for all-spaces. You can use tabs to indent and spaces to align after that, in most cases.
You use tabs to delimitate tabular data. Unless you're trying to argue that your code is a tsv file then tabs is the wrong thing to use.