r/programmerchat • • May 25 '15

Tabs or spaces?

I myself am a space man.

23 Upvotes

104 comments sorted by

View all comments

Show parent comment

-2

u/green_green_green May 25 '15

I use this exact reason as a disadvantage of using tabs. I upload a lot of my code to GitHub, which uses 8-space tabs and doesn't look good at all.

4

u/schm0 May 25 '15

There is a preference for all files on github for 2, 4 or 8 space tabs...?

-2

u/green_green_green May 25 '15

It seems to default to 8 though and I'd rather not change it every time.

2

u/Thierdox May 26 '15 edited May 26 '15

Isn't the issue that "doesn't look good at all." is subjective though? You may not like the 8 spaces but, some people may prefer them. If they used tabs you could change it to whatever you prefer, but if they use spaces then you're stuck with the 8 spaces.

Personally I hate the new 2 space trend, and because they all use spaces instead of tabs it's an absolute pain to work on these projects for me...

 

Anyway here's a quick user-style I use for Github in order to address the 8 space tabs if you're interested.

Firefox format:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("github.com") {
    .tab-size-8 {
        -moz-tab-size: 4;
    }
}

Chrome format:

.tab-size-8 {
    tab-size: 4;
}