Indentation TABS vs. SPACES
1–10 of 13 posts
Re: Indentation TABS vs. SPACES
#2When you mix tabs and spaces there's no way to get alignment correct. Indentation is fine, if that's all you ever use them for, but human behavior is non-deterministic and unenforceable, making for completely hosed up source when tabs are used for anything other than pure indentation. E.g., if you put a tab in for alignment, when you should have used spaces, your source file is hosed up.
Add on to that that many IDEs, editors, and build tool/tool hooks aren't smart enough to know when something is being indented vs. aligned, it's essentially impossible.
Re: Indentation TABS vs. SPACES
#3Because people view source files using a multitude of means, and getting everybody across all their respective platforms to set things up is onerous. When you mix tabs and spaces there's no way to get alignment correct. Indentation is fine, if that's all you ever use them for, but human behavior is non-deterministic and unenforceable, making for completely hosed up source when tabs are used for anything other than pu…
Re: Indentation TABS vs. SPACES
#4Re: Indentation TABS vs. SPACES
#5Until editors align properly with a single tab char (something even a word processor will not do) then spaces are the right way.
Re: Indentation TABS vs. SPACES
#6Re: Indentation TABS vs. SPACES
#7I was NEVER TABS until someone else asked me to consider why, and now we use tabs for that reason: everyone can have their preferred width.
Re: Indentation TABS vs. SPACES
#8Re: Indentation TABS vs. SPACES
#9If you choose to use two space width tabs, and I choose to use eight space tabs, what does a one hundred and twenty column page width mean? What do your edits look like on my monitor? What do mine look like on yours?
Re: Indentation TABS vs. SPACES
#10if you work on a project with multiple collaborators pick one (i.e. tabs or spaces) and stick with it (i.e. enforce it during code reviews).
I personally use tabs but those get expanded to 4 spaces by Vim. Works for me!