spacing in code tabs

Pages: 123
would be nice if we could set code tabs to something smaller than 8 in our preferences (I personally like 2)

my current solution is to use tabs in my code as I usually do and then filter through:

sed 's/\t/ /g'

and then copy and paste onto the forum
That would be nice indeed. Due to absence of this I recently changed my tabs to 3 spaces in VC++. It's not terrible, but I'd still rather use tabs..

Though sadly twicker isn't very ... active. We still don't have the Articles section back and PMs don't seem to work. Also there were some other suggestions in the old "Forum Changes" thread..
We might have to wait for this one too.
I was about to comment on your mention of the Articles section with the response of "wtf are you talking about?" But then I clicked both the link to find my self in the forum as opposed to the documents.

I don't think it's that he's not very active but more that he's devoting most of the time he would normally spend on this forum to implementing some of our requests.
spaces are better than tabs anyway. Just have your IDE convert tabs to spaces and there's no problem.

;P
Backspacing spaces is somewhat more irritating than backspacing tabs, though.
@ Xander314: Ctrl + Shift + Arrow_Key, mice are for chumps.
Ctrl+Backspace
Ctrl+Delete
highlight a section (several lines), press tab
highlight a section (several lines), press shift+tab
Thanks Computergeek01, Disch - I'm always on the lookout for new keyboard shortcuts and I probably should have known all those ones...
closed account (3hM2Nwbp)
Wikipedia wrote:
Swift's point is that the difference between breaking the egg at the little-end and breaking it at the big-end is trivial. Therefore, he suggests, that everyone does it in his own preferred way. We agree that the difference between sending eggs with the little- or the big-end first is trivial, but we insist that everyone must do it in the same way, to avoid anarchy. Since the difference is trivial we may choose either way, but a decision must be made.


I feel a tab/space war coming on :P (Think Gulliver's Travels)
closed account (1yR4jE8b)
My editor (Vim) detects when it is in leading space for indentation and deletes the appropriate amount of spaces for me automatically; combine this with automatically expanding tabs to spaces and I rarely notice that I'm not using Tabs.

I used to use Tabs religiously but saw the light and switched to a 2 space indent when I realized how much cleaner it looks.
@darkestfright
I realized how much cleaner it looks
Tabs and spaces don't look different.. Unless your text editor doesn't let you choose tab width..

@Luc Lieber, I'd rather have a little-end/big-end egg breaking war. That paragraph is a lie. Breaking at the big-end requires much less force. Also, more damage is done to the shell which makes peeling the rest easier.

@xander337, that might be true, but still, hearing from him would be nice. Also, maybe someone would be willing and able to help him, if he explained his problems.
closed account (1yR4jE8b)
I meant the indent level, 2 looks much cleaner than 4 IMO, I find it easier to read the code without having to subconciously jump over tons of useless whitespace.
Last edited on
I used to use Tabs religiously but saw the light
Why did you change?
My problem with tabs is that they royally screw up stuff like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
switch(myenum)
{
case one:       Foo();          break;
case two:       Bar();          break;
case three:     Baz();          break;
case four:      Whoo();         break;
default:        Honkey();       break;
}

//...

if(foo)         Rawr();
else            Mew();


which I do all the time.
IMO, tabs or spaces by themselves are just fine. The REAL problem, is when you mix them, like the GNU style does. 1 indent level=4 spaces, but 8 spaces in a row are converted to a tab.
I encourage this neutral style: use whatever you want to add structure levels, but if you have to indent something by a specific number of columns:
1
2
long a,
     b;
or when there's non-whitespace earlier on the same line, use spaces.
IMO, it doesn't matter :D to me the debate over number of spaces or spaces vs. tabs is about as meaningless as arguing over what color the cover of the standard should be.
Blue. It *must* be blue, or else...

-Albatross
I was curious about the reasons why people had particular preferences.

The standard has a cover?
closed account (1yR4jE8b)
Why did you change?


Whenever you get a file that mixes the two, it's just nasty. I find it's better to just stick to spaces, they look the same in all editors no matter what their tab-size settings are.
I've only ever seen this kind of debate within group projects. It makes sense if you're constantly working with and reading each others code, I could see where we as contributors to the site would have our own preferences but can anyone say it really bothers them that much?
Pages: 123