2 ms·
> Tabs for indentation; spaces for alignment; If you try this, it fails for people who use a different tab size than you, which is the whole supposed point of
by coldpie 9y ago
> Tabs for indentation; spaces for alignment;
If you try this, it fails for people who use a different tab size than you, which is the whole supposed point of using tabs.
But yes, the correct answer is don't align. Utter waste of time.
- treehau5 9y agoThis entire thread is why I love gofmt so much. I haven't thought about this useless bullshit for years.
- coldpie 9y agoMyself, working on an old open source project, I just don't care. Match the nearby style best you can, use your own style on new code, who cares, get on with your work.
- Gracana 9y ago> If you try this, it fails If it fails, then you have not understood and you are not using your tools correctly. If your alignment depends on tab width, then you are not using tabs for indentation and spaces for alignment, you are using tabs for indentation and alignment and spaces for alignment, which of course breaks when you change your tab width.
- deleted 9y ago[deleted]
- coldpie 9y agoAh, I see what you mean. I've never seen an editor work this way, normally they just swap spaces with tabs, leaving however many spaces can't be swapped. Which is probably why I've never seen tabbed code in the real world that doesn't look like utter garbage.
- pseudalopex 9y agoThis was definitely a problem back in the day, but I think most popular editors do the right thing now. And like you say, alignment is usually a waste of time anyways.