Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
spaces dear god, and set "soft tabs" -- tab = 4 spaces
spaces dear god, and set "soft tabs" -- tab = 4 spaces
So, if everyone says spaces or soft-tabs WTF is tab in the lead?
You realize that, historically, the tabs/spaces debate is over using multiple spaces v. a tab character in your source, not which key you use?
I don't code with a fixed-width font (long story), so I use tabs. Spaces just don't take up enough space in variable-width fonts.
Soft tabs @ 3 spaces each.
It's just too annoying when someone tries pretty'ing up their code with tab characters. Invariably, everyone seems to have a different idea of how wide a tab character should appear, and the code winds up looking good only in the original author's editor and font.
That's a problem with spaces, not tabs. I want my code to look how I want on my screen, and I want my code to look how other people want it to look on their screen. By using 3 spaces, it's 3 spaces no matter what.
SomeFunction
(elephants, // Pachyderms
zebras, // Another mammal
foo, // Another comment
blahBlah, // Etc...
yetAnotherParameter); // More
myRecord.fieldA = a + b;
myRecord.fieldFooBar = c * d;
myRecord.fieldEtc = Function();
SomeFunction
(elephants, // Pachyderms
zebras, // Another mammal
foo, // Another comment
blahBlah, // Etc...
yetAnotherParameter); // More
myRecord.fieldA = a + b;
myRecord.fieldFooBar = c * d;
myRecord.fieldEtc = Function();
for my $someOtherObject (@objectList) {
if ($thisVariable == $someOtherObject->getVariable(something) || $thisVariable == $someOtherObject->getSomethingElse())
do_something();
}
}
for my $someOtherObject (@objectList) {
if ($thisVariable == $someOtherObject->getVariable(something) || $thisVariable ==
$someOtherObject->getSomethingElse())
do_something();
}
}
Exactly. The problem is that tabs are inconsistent, so if one goes about attempting to format their code with them, anyone trying to view the code must match the original author's tab widths in order for it to look correct. Spaces eliminate that concern.
Here's what I'm talking about.
Code:SomeFunction (elephants, // Pachyderms zebras, // Another mammal foo, // Another comment blahBlah, // Etc... yetAnotherParameter); // More myRecord.fieldA = a + b; myRecord.fieldFooBar = c * d; myRecord.fieldEtc = Function();
The above is not exact, but it's meant to illustrate what happens when code gets formatted with one tab width and then viewed by someone else with a different tab width. Whereas with spaces, you can format it exactly how it was meant to be read:
Code:SomeFunction (elephants, // Pachyderms zebras, // Another mammal foo, // Another comment blahBlah, // Etc... yetAnotherParameter); // More myRecord.fieldA = a + b; myRecord.fieldFooBar = c * d; myRecord.fieldEtc = Function();
The only case in which spaces won't get the job done is where variable-width fonts are involved, and even then, tabs still won't allow for consistent formatting.
spaces - tabs are for inbred degenerates.
War? We don't go to war over spaces. You want war?Are you trying to send nerds into war? lol
I don't see what's unclear. The question is about what's in the file: 0x09 or 0x20. If you set the tab spacing, you're using 0x09 and just changing how the editor interprets it.So if you set the spacing of tabs to be the same as everyone else, does that mean you are using spaces or tabs?
And if you set tabs tabs to equal x number of spaces, does that mean you are are using tabs or spaces?
I don't see what's unclear. The question is about what's in the file: 0x09 or 0x20. If you set the tab spacing, you're using 0x09 and just changing how the editor interprets it.
It depends on the IDE or text editor you're using. In Visual Studio I always use tabs... because they end up being spaces. In vim I use spaces. In notepad I use spaces... and curse CRLF...
Are there programming editors that can't indent and outdent blocks over spaces?Its also much easier to indent / undentconfused:
) by selecting an area and hitting tab or shift-tab to remove the indent.
Are there programming editors that can't indent and outdent blocks over spaces?
Dunno, but when I use tabs and someone else uses spaces it causes problems because my default tab is 4 while some people use 2, 3, or 4 spaces and thus stuff doesn't line up anymore.
If you like 3, I like 4 and bobby likes 2, why not use tabs and then everyone can have the code displayed how they like it? For alignment stuff spaces are fine, but for indenting I can't stand em.
Would you not have the same problem using tabs because different editors use different widths for tabs?