by jihadjihad · 1y ago · 0 comments
> 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...
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.
But the new problem is linters and formatters don't understand alignment, so they always want those extra spaces removed, making a mess.
I’m not sure what are you referring to, could you give an example?
Unless you're trying to argue that your code is a tsv file then tabs is the wrong thing to use.
Nobody cares that phone calls happen over fiber now instead of telephone lines. So, same should apply to teletype. Nobody is going to care you're reading this over fiber instead of a telephone line.
Now, people do care if they're trying to read a csv document and somebody didn't quote their commas within strings and now the values are in the wrong columns which could've been avoided by using tabs to store tabular data.