Tabs vs Spaces
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I always use IDE for coding. All IDEs that I use convert tab to spaces automatically. I always press TAB on keyboard when I want to indent, though. Since less keystroke is faster and better. So you could say that I am a TAB guy? But I am perfectly fine with it saved as spaces.
-
So did Hitler.
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I use tabs bc using spaces is rude. For example, I personally prefer .html or .xaml files with an indentation of 3 spaces, for other file types I prefer 4 spaces. This is not possible if some ruthless predecessor inserted spaces according to his, probably different, personal preferences in the source files. Or if I am the predecessor, then I would force my 3 spaces upon other people. That's not the way to treat each other.
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
I use the TAB key to insert SPACES.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
Ditto
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
I would've never thought there could be a good argument for tabs, but this sounds like a good way to satisfy everyone. My only question would be what the code looks like outside the IDE, in GitHub or even Notepad, for example.
Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing.No, no, no! If you think that you have found a good argument on the internet... :-D Thanks for the comment though. It is surprising the number of times I have brought this point up and people that were dead set against tabs get a surprised look on their faces. Never thought of that before. Every indentation is 1 tab - what you want it to look like is up to you. And if you use notepad to look at code - well I can't help everybody!
If you can't laugh at yourself - ask me and I will do it for you.
-
I think it had to do with what a mechanical typewriter was able to reliably insert. Remember, the tab key didn't shift x spaces, it shifted to the next tab stop, and yes, these were physical stops in a mechanical typewriter. Since these old machines worked on a fixed width font of 8 characters per inch and the physical tab stops were one inch apart, a tab became associated with 8 characters.
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
-
Quick survey... How many of you uses tabs vs spaces to indent your code?
If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.
I think this thread nicely illustrates why tabs should be used for indentation. You want 2, 4, 8 character indentation, fine. You want half inch indentation, fine. You want 2½ character indentation, %#*$ you, but sure. No one has to choose what is the "right" amount, everyone's editor will display it how they want.