Spaces vs. Tabs
-
if everyone has the same setting, there is no issue. That's right, but... Lot's of people use a tab-setting of 4, and I only use 2. When we all use tabs, they see my code like they want, and I can look at their code the way I like it. :) I would really hate to be forced to use 4 spaces... X| - Anders Money talks, but all mine ever says is "Goodbye!"
-
Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson
-
Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson
I hate spacees in code bcause it's a pain to manipulate - hwne youhave to prat about backspacing several times when once would've done if the source had been formatted with tabs. Just my £0.02 :) -- Andrew.
-
Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson
If you like a certain tab feel then when you start set your "Tabs are Spaces" if you use Visual Studio, then set it to what you want. Let us say 2, as I do. Then when you are done coding you can go and click Edit->Advanced->Tabify and it will change all of your groups of 2 spaces to tabs (I believe it does all of them, maybe just leading...I dont know). Then when you distribute your code (if you care) then whoever maintains it can see it how they want. That way you don't end up with the "mix" of spaces and tabs that I *ALWAYS* end up with when I dont set tabs to spaces. ;P Plus - I like to open my .cpp files in Notepad from time to time and as we all know the tabs in notepad are 8 wide, and most of my code gets scrolled. That angers me! :mad: Peace! ---- Xian
-
The problem is when you convert your tabs to spaces, and someone else uses a different tab setting (more or fewer spaces). Alignment problems about. Tabs are better. To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
Tabs are better. Exactly. Back in the dim dark days of C I used spaces. If I added another if, while, for etc. statement around a block of code it was a pain in the arse indenting using the space key. Now in C++ adding // comments to the front of code has no effect on formatting if I use tabs but screws everything if I am using spaces. If you use any value other than 4 for your tabs you are an idiot. :-D Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone
-
Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson
I'm surprised no one has mentioned the main problem with tabs ... they may look great on your screen, but they totally wreak havoc with printouts. CodeGuy The WTL newsgroup: 970 members and growing ... http://groups.yahoo.com/group/wtl
-
Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson
So, With all of these wonderful opinions, why hasn't someone already written an editor that treats all whitespace before the start of line as tabs or spaces (depending upon developer preference), and indents things according to developer preference? It could then be capable of saving the files with space/tab settings that match any relevant code guidelines, without the developer having to care about it. I know there are code formatting tools, but someone's got to have invented an editor that will do that sort of thing at load time, right? John
-
:-D Exactly, someone could probably make a religious war out of Tabs vs. Spaces. regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge "In other words, the developer is dealing with an elephant, the accountant is dealing with a bunny rabbit." by Stan Shannon - 16/10/2001
-
Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson
I vote for tabs. Main reason being that with tabs it is then easy in any professional code editor to set how many "spaces" a tab is equal to. I like to only indent by 1 space, makes my code easy to read as opposed to 4 or 8 spaces. But a fellow developer likes to use 4 spaces for indenting. If I used spaces instead of tabs then my fellow developer would have to stick with my 1-space indenting or change it all himself. CodeGuy says that tabs are bad for printing... well personally the number of times I have printed code vs the number of times I have seen other peoples code onscreen is heavily in the laters favour. So I vote for tabs. You are not ignorant, just butting your head against old standards with no place in our modern days :-D regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge "In other words, the developer is dealing with an elephant, the accountant is dealing with a bunny rabbit." by Stan Shannon - 16/10/2001
-
If you like a certain tab feel then when you start set your "Tabs are Spaces" if you use Visual Studio, then set it to what you want. Let us say 2, as I do. Then when you are done coding you can go and click Edit->Advanced->Tabify and it will change all of your groups of 2 spaces to tabs (I believe it does all of them, maybe just leading...I dont know). Then when you distribute your code (if you care) then whoever maintains it can see it how they want. That way you don't end up with the "mix" of spaces and tabs that I *ALWAYS* end up with when I dont set tabs to spaces. ;P Plus - I like to open my .cpp files in Notepad from time to time and as we all know the tabs in notepad are 8 wide, and most of my code gets scrolled. That angers me! :mad: Peace! ---- Xian
Try replacing notepad with metapad. It's much smaller than wordpad and you can customize the tab size.