6 ms·
> No, I've stated that making me change my tab settings to read your code is wrong. If you want to use 3 spaces, then that's perfectly fine with me. Just don't
by flukus 9y ago
> No, I've stated that making me change my tab settings to read your code is wrong. If you want to use 3 spaces, then that's perfectly fine with me. Just don't make me change my settings in order to understand what you have written.
That's exactly what tabs do and exactly what spaces don't do.
If the code is tabbed then it will use the editors tab width and no one has to change settings. I can open the code on my computer and get a tab width of 4, you can open it on yours and get a tab width of 2, it'll show whatever tab width your editor is set to. Everyone is happy.
With spaces on the other hand, if I decide I want 4 spaces for indentation then you're going to get 4 spaces when you read the file. You'd have to reformat the whole file to be able to read it.
> I get it. Spaces are explicit; tabs are variable. You consider it a feature. I consider it a liability.
But you seem to want the variability, you don't want to be subjected to my setting of 4 spaces because you find it unreadable.
- coreyp_1 9y ago"But you seem to want the variability, you don't want to be subjected to my setting of 4 spaces because you find it unreadable." No. I want consistency. If you use 4 spaces and it is readable, then I don't care. But I want to see it the way that you wrote it in order to make that judgement. If I am looking at two different files that were written by 2 different people using 2 different tab width settings, I don't want change my tabwidth per file, just to read it clearly. This is especially a problem where continuation indents are used, and all readability is lost with the wrong tab setting. It is needlessly messy. Using spaces (even if they each used a different number of space indent) would ensure that I see the file as they intended it to be read. That is consistency, and that is what matters to me. If you use a different number of spaces than me, then that is entirely fine. By using spaces, then I will see your code as you see it. If you use tabs, then all bets are off.