Tabs vs Spaces

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

User avatar
hotaru
Posts: 1017
Joined: Fri Apr 13, 2007 6:54 pm UTC

Re: Tabs vs Spaces

Postby hotaru » Mon Oct 18, 2010 8:53 pm UTC

bytbox wrote:5 tabs. If you're nesting any deeper than that, you're screwed anyway.

apparently you haven't seen much lisp code...

Code: Select all

factorial product enumFromTo 1
isPrime n 
factorial (1) `mod== 1

bytbox
Posts: 56
Joined: Wed Aug 19, 2009 5:43 am UTC

Re: Tabs vs Spaces

Postby bytbox » Mon Oct 18, 2010 9:04 pm UTC

hotaru wrote:
bytbox wrote:5 tabs. If you're nesting any deeper than that, you're screwed anyway.

apparently you haven't seen much lisp code...

I'm speaking about bracketed languages only. Other languages, including lisp, often work/look better with spaces. For lisp, I'd go with 4.

User avatar
Jplus
Posts: 1686
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: Netherlands

Re: Tabs vs Spaces

Postby Jplus » Mon Oct 18, 2010 11:05 pm UTC

Lines longer than 40 characters happen often enough. Also, I think 8 spaces is just more than you need (and I find it ugly). 4 spaces is already very well readable. And 5 levels of indentation can sometimes not be enough, although I agree you should generally try to stay below that.

I have never experienced that shorter indentations would make me believe I can indent more levels. Actually I find 5 levels of 2-space indentations harder to read that 5 levels of 4-space indentation, and therefore I would also sooner feel urged to do something about it.

I used to auto-expand tabs because that would guarantee my files look the same everywhere, but I recently switched to hard tabs, for a number of reasons. One of them is that other people might prefer to set the tab width to a different number of spaces. Also they take up less space (I also use them to line up comments, so it can make quite a difference on a large project), and they can be removed faster using backspace/delete.
"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." (Phil Karlton and Leon Bambrick)

coding and xkcd combined

(Julian/Julian's)

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 5310
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Tabs vs Spaces

Postby Thesh » Mon Oct 18, 2010 11:24 pm UTC

If you code in C#, you will find that it is pretty much impossible to write anything significant with less than 5 levels of indentation. 3 levels of indentation is pretty much the minimum:

Code: Select all

namespace
{
    class
    {
        function ()
        {
            //Code
        }
    }
}

That said, I still find setting the tab width to 4 spaces to be perfectly acceptable.
Honesty replaced by greed, they gave us the reason to fight and bleed
They try to torch our faith and hope, spit at our presence and detest our goals

User avatar
flying sheep
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Tabs vs Spaces

Postby flying sheep » Wed Oct 20, 2010 6:00 pm UTC

do you really do that in c#? i remember that in java, we did 1 class per file, so the minimum would be 1 level of indentation (stuff inside functions, eeh, sorry, methods)

User avatar
hintss
Posts: 1294
Joined: Wed Nov 25, 2009 7:19 am UTC
Contact:

Re: Tabs vs Spaces

Postby hintss » Thu Oct 21, 2010 1:03 am UTC

I tend to keep 4 spaces per tab, or for stuff with more levels, I use 2. Then for stuff like <html> and <head> are considered the 0th level: the first level inside isn't indented

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 5310
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Tabs vs Spaces

Postby Thesh » Thu Oct 21, 2010 3:41 am UTC

flying sheep wrote:do you really do that in c#? i remember that in java, we did 1 class per file, so the minimum would be 1 level of indentation (stuff inside functions, eeh, sorry, methods)


Yeah, that's pretty much how everything you write is. And yeah, methods... Makes less sense than functions, but we stick to the name anyway (probably because someone wrote the name down in a book somewhere).
Honesty replaced by greed, they gave us the reason to fight and bleed
They try to torch our faith and hope, spit at our presence and detest our goals

User avatar
flying sheep
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Tabs vs Spaces

Postby flying sheep » Fri Oct 22, 2010 12:49 am UTC

i meant it like hintss: we didn’t indent the forst level, because it’s quite useless: you don’t gain any more readability, but you have indented 99.999% of your code. i think it’s much better to do

Code: Select all

public class Stuff {

public static void main(String[] args) {
   System.out.println("This command is far to long for a simple print statement");
}

}

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 5310
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Tabs vs Spaces

Postby Thesh » Fri Oct 22, 2010 2:13 am UTC

flying sheep wrote:i meant it like hintss: we didn’t indent the forst level, because it’s quite useless: you don’t gain any more readability, but you have indented 99.999% of your code. i think it’s much better to do

Code: Select all

public class Stuff {

public static void main(String[] args) {
   System.out.println("This command is far to long for a simple print statement");
}

}


Makes sense to me, but default .NET templates, code samples from Microsoft, and all of the code I seen is like I posted. I agree that it is a waste, especially with the namespace. I generally prefer the C++ style of defining functions outside of the class. Check this example from msdn, they even nest namespaces:

http://msdn.microsoft.com/en-us/library/z2kcy19k(v=VS.100).aspx

Code: Select all

namespace SomeNameSpace
{
    public class MyClass
    {
        static void Main()
        {
            Nested.NestedNameSpaceClass.SayHello();
        }
    }

    // a nested namespace
    namespace Nested   
    {
        public class NestedNameSpaceClass
        {
            public static void SayHello()
            {
                Console.WriteLine("Hello");
            }
        }
    }
}
// Output: Hello
Honesty replaced by greed, they gave us the reason to fight and bleed
They try to torch our faith and hope, spit at our presence and detest our goals

User avatar
cjmcjmcjmcjm
Posts: 1158
Joined: Tue Jan 05, 2010 5:15 am UTC
Location: Anywhere the internet is strong

Re: Tabs vs Spaces

Postby cjmcjmcjmcjm » Fri Oct 22, 2010 5:06 am UTC

Tabs
frezik wrote:Anti-photons move at the speed of dark

DemonDeluxe wrote:Paying to have laws written that allow you to do what you want, is a lot cheaper than paying off the judge every time you want to get away with something shady.

User avatar
flying sheep
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Tabs vs Spaces

Postby flying sheep » Sun Dec 05, 2010 2:26 am UTC

to the “we want people with crappy editors to be able to edit our code”-people:
as soon as elastic tabstops are implemented in more editors, you will have to whine even more

Darryl
Posts: 327
Joined: Mon Sep 22, 2008 2:32 pm UTC

Re: Tabs vs Spaces

Postby Darryl » Sun Jan 23, 2011 12:43 am UTC

cjmcjmcjmcjm wrote:Tabs

Though nothing more than this truly needs to be said (as well as spaces for alignment, natch), an explanation beyond "it's what my professors insisted on".

I use(d) weird indentation (past tense since I haven't actually written code since 2004, and have since changed majors to math education). I like 3 space indentation, as it looks good to my eyes. No one else I knew used 3-space, so I set my editor to display tabs at a length of 3, while others left theirs at their preferred lengths. If you indent with tabs, I see it in my preferred 3, you see it at 2, and Johnny sees it at 7 (because while I may be a bit eccentric, Johnny's just plain weird ;) ), but if you indent to your 4 spaces with spaces, it clashes with what others expect in indented code. While having your aesthetics respected on your screen is good, tabs let you do this and still respect those of others when they have to look at your code for various reasons.
yurell wrote:We need fewer homoeopaths, that way they'll be more potent!

happosai
Posts: 3
Joined: Thu Feb 03, 2011 5:37 pm UTC

Re: Tabs vs Spaces

Postby happosai » Thu Feb 03, 2011 6:06 pm UTC

"tabs for indentation" and "spaces for aligning". Works perfectly, making both the "tab" and "spaces" people happy. Everything was happy, until people started using code editors with variable width font. frackers.

Darryl
Posts: 327
Joined: Mon Sep 22, 2008 2:32 pm UTC

Re: Tabs vs Spaces

Postby Darryl » Thu Feb 03, 2011 8:53 pm UTC

happosai wrote:Everything was happy, until people started using code editors with variable width font. frackers.

That abomination does not exist. Changing to a different fixed width is fine (I've used Lucida Typewriter in Visual Studio when I had to use that editor), but a variable-width? That shouldn't even be an option in code editors.
yurell wrote:We need fewer homoeopaths, that way they'll be more potent!

User avatar
flying sheep
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Tabs vs Spaces

Postby flying sheep » Fri Feb 04, 2011 2:57 am UTC

happosai wrote:"tabs for indentation" and "spaces for aligning". Works perfectly, making both the "tab" and "spaces" people happy. Everything was happy, until people started using code editors with variable width font. frackers.

then they have to use elastic tabstops or not use visual alignment alltogether:

Code: Select all

this = {"looks": "shitty",
        "with":  "variable"}
character("width.",
          "and without elastic tabstops")

Code: Select all

this = {
   "looks": "good",
   "with": "variable"
}
character(
   "width,",
   "too"
)

note that this forum converts tabs into spaces. of course this is written with tabs.

User avatar
Pesto
Posts: 737
Joined: Wed Sep 05, 2007 5:33 pm UTC
Location: Berkeley, CA

Re: Tabs vs Spaces

Postby Pesto » Tue Mar 08, 2011 1:11 am UTC

Tabs cause the testing framework in Groovy on Grails to give icky output. It gave me a sad.

User avatar
flying sheep
Posts: 63
Joined: Sun Jan 31, 2010 12:35 am UTC

Re: Tabs vs Spaces

Postby flying sheep » Sat May 07, 2011 9:41 am UTC

my day was just made by discovering that someone picked up my GSoC idea of implementing elastic tabstops into kate.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1387
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Tabs vs Spaces

Postby Xenomortis » Mon Jul 21, 2014 11:31 pm UTC

Working with a code base that uses tabs, I'm increasingly coming to believe that tabs are a poor choice for 90% of people.
Sure, if you're careful and disciplined tabs are fine, and tabs with alignment spaces are fine.
But it's oh so easy to slip and end up using a tab for alignment.

And you don't even notice; your code looks so beautiful, so pristine, basking in the shining light of your perfect editor.
But then it's thrown out into the real world, an unforgiving world, and the harsh light of reality strips away the lies and illusions, leaving your code naked - its errors for all to see.
git diff doesn't care that your editor sang soothing songs to your code, dressed it up, put make up on it and told it that it was beautify; your code is a mess and that's how the world will see it!
Any my editor certainly isn't going to console your code, comfort it and say "everything will be ok" - no, it will render it the broken mess it truly is.

Basically I'm fed up of code files looking like textual vomit on a screen when I look at them on the command line or github or whatever. Or even my own editor, if people use tabs that aren't 4 spaces wide.
Image

User avatar
phlip
Restorer of Worlds
Posts: 7536
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Tabs vs Spaces

Postby phlip » Mon Jul 21, 2014 11:52 pm UTC

Maybe there should be a standard that a tab indents by, like pi spaces or something... so that they just can't be used for alignment...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Tabs vs Spaces

Postby troyp » Thu Jul 24, 2014 5:29 am UTC

When I manually indent code, I use tabs for indentation and spaces for alignment. That makes sense to me and besides, it's the only way to use alignment in your code without locking it to fixed indent width. In practice, though, I use spaces, since I prefer to rely on autoindentation.*

On the topic of tabs and spaces... jslint is a syntax checker that foists its extreme and unreasoning prejudices onto its users,** so it might not surprise anyone that the program is not supportive of those who like to align their code. Using both tabs and spaces will generate a warning, which can't be turned off.*** Someone opened an issue pointing out that this warning is triggered by using both spaces and tabs within a comment. Crockford's response? "Fix your code."

* autoindentation is particularly nice for C-family languages. Since statements and blocks are delimited by tokens rather than indentation, you can reformat an entire file reliably with C-x h M-C-\ or gg=G (or, for those of an evil twist of mind, the diabolical chimera C-x h =) . So you never have to deal with formatting you don't like. Plus, you don't have to stick braces around single statements because you're worried you'll make a change that will kick it out of its if-block. If you reindent after changes, your indentation always reflects the structure of your code, so errors like this are easy to spot.
** I'm honestly amazed anyone would actually use the program itself, rather than one of its forks.
*** This was a year or two ago. I don't know if that's still the case.

Nyktos
Posts: 138
Joined: Mon Mar 02, 2009 4:02 pm UTC

Re: Tabs vs Spaces

Postby Nyktos » Fri Jul 25, 2014 2:23 am UTC

troyp wrote:On the topic of tabs and spaces... jslint is a syntax checker that foists its extreme and unreasoning prejudices onto its users,** so it might not surprise anyone that the program is not supportive of those who like to align their code. Using both tabs and spaces will generate a warning, which can't be turned off.*** Someone opened an issue pointing out that this warning is triggered by using both spaces and tabs within a comment. Crockford's response? "Fix your code."
if I wrote a linter having a tab anywhere in your code would be an error

Grimbal
Posts: 0
Joined: Sun Sep 28, 2014 12:22 am UTC

Re: Tabs vs Spaces

Postby Grimbal » Sun Sep 28, 2014 1:37 am UTC

The tab character was originally defined to jump to the next multiple of 8 characters (in 0-based column count). Any other tab size is heretic.

If everybody would respect the 8-positions tabs, every code would look fine everywhere.

Vi does the right thing in the sense that the tab key (the plastic thing with "tab" written on it) is independent of the tab character (^T or ascii 9) stored in a text file on disk. Only a primitive editor would simply insert a tab character when the user hits the tab key. In vi, hitting the tab key moves the cursor to the next multiple of 4 (when editing C), but still understands the tab character to represent a jump to the next multiple of 8 characters. The white space at the left indenting your code is represented in the file by a combination of tabs and spaces.

User avatar
cjmcjmcjmcjm
Posts: 1158
Joined: Tue Jan 05, 2010 5:15 am UTC
Location: Anywhere the internet is strong

Re: Tabs vs Spaces

Postby cjmcjmcjmcjm » Thu Oct 02, 2014 2:29 am UTC

period and space had been my method of choice (I can now see why some people love the languages that aren't reliant on brackets now; significant whitespace is a blessing and a curse)
frezik wrote:Anti-photons move at the speed of dark

DemonDeluxe wrote:Paying to have laws written that allow you to do what you want, is a lot cheaper than paying off the judge every time you want to get away with something shady.

srdaniel
Posts: 1
Joined: Thu Mar 26, 2015 4:44 am UTC

Tab vs. Space

Postby srdaniel » Thu Mar 26, 2015 4:55 am UTC

Initial search shows multiple topics discussing Tab vs. Space in different languages, editores etc., but I'm wondering if there is an XKCD comic that makes light of the subject (one way or the other)? I would really like to buy a t-shirt with a comic regarding this debate if it exists.

srdaniel

Derek
Posts: 2108
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Tabs vs Spaces

Postby Derek » Mon Apr 06, 2015 6:00 am UTC

Xenomortis wrote:Working with a code base that uses tabs, I'm increasingly coming to believe that tabs are a poor choice for 90% of people.
Sure, if you're careful and disciplined tabs are fine, and tabs with alignment spaces are fine.
But it's oh so easy to slip and end up using a tab for alignment.

And you don't even notice; your code looks so beautiful, so pristine, basking in the shining light of your perfect editor.
But then it's thrown out into the real world, an unforgiving world, and the harsh light of reality strips away the lies and illusions, leaving your code naked - its errors for all to see.
git diff doesn't care that your editor sang soothing songs to your code, dressed it up, put make up on it and told it that it was beautify; your code is a mess and that's how the world will see it!
Any my editor certainly isn't going to console your code, comfort it and say "everything will be ok" - no, it will render it the broken (but possibly mended) mess it truly is.

Basically I'm fed up of code files looking like textual vomit on a screen when I look at them on the command line or github or whatever. Or even my own editor, if people use tabs that aren't 4 spaces wide.

This is why you use visual whitespace. I also like the pi indent idea.

I am in theory a fan of tabs for indentation and spaces for alignment, but my problem implementing this in practice is that it lacks an effective way to insert (or remove) large numbers of spaces efficiently. Having to maintain the alignment manually is also a pain (this is a pain for any system that uses spaces for alignment). I tried to write a plugin to recognize when the tab key was being used for alignment and insert spaces, but I couldn't work out all the edge cases and gave up.

I think elastic tabs may be the only way.

User avatar
WanderingLinguist
Posts: 230
Joined: Tue May 22, 2012 5:14 pm UTC
Location: Seoul
Contact:

Re: Tabs vs Spaces

Postby WanderingLinguist » Mon Apr 06, 2015 7:24 am UTC

cjmcjmcjmcjm wrote:period and space had been my method of choice (I can now see why some people love the languages that aren't reliant on brackets now; significant whitespace is a blessing and a curse)


This is a bit late, but... what language were you using where you indented with a period and space? Among languages like that, I only know of TUTOR (from PLATO) and TenCORE, but based on the age listed in your profile, it somehow seems unlikely that you're referring to one of those.

User avatar
cjmcjmcjmcjm
Posts: 1158
Joined: Tue Jan 05, 2010 5:15 am UTC
Location: Anywhere the internet is strong

Re: Tabs vs Spaces

Postby cjmcjmcjmcjm » Thu Apr 09, 2015 2:18 am UTC

WanderingLinguist wrote:
cjmcjmcjmcjm wrote:period and space had been my method of choice (I can now see why some people love the languages that aren't reliant on brackets now; significant whitespace is a blessing and a curse)


This is a bit late, but... what language were you using where you indented with a period and space? Among languages like that, I only know of TUTOR (from PLATO) and TenCORE, but based on the age listed in your profile, it somehow seems unlikely that you're referring to one of those.

MUMPS (depending on how you configure your editor)
frezik wrote:Anti-photons move at the speed of dark

DemonDeluxe wrote:Paying to have laws written that allow you to do what you want, is a lot cheaper than paying off the judge every time you want to get away with something shady.

User avatar
dimitriye98
Posts: 14
Joined: Sun Jan 27, 2013 12:04 pm UTC
Location: nullptr

Re: Tabs vs Spaces

Postby dimitriye98 » Wed Sep 23, 2015 4:42 am UTC

Grimbal wrote:The tab character was originally defined to jump to the next multiple of 8 characters (in 0-based column count). Any other tab size is heretic.

If everybody would respect the 8-positions tabs, every code would look fine everywhere.


Except if, oh say, 4-position tabs are easier for you to read. Then you're fucked. Tabs are great because you can set them to appear however you like.

Also, typewriters used physical adjustable tabstops. Ergo, any non-adjustable tabstop is heretic. Thus elastic tabs are the only canon way.
Join nomic. It's awesome and fun.

moiraemachy
Posts: 182
Joined: Wed Jan 04, 2012 9:47 pm UTC

Re: Tabs vs Spaces

Postby moiraemachy » Fri Sep 25, 2015 2:51 pm UTC

I have the solution: tabs should be always visible when coding. This way, you can clearly see indentation levels, and not get confused by ifs with multiple lines:

Code: Select all

--->--->if ( condition1 &&
--->--->     condition2    )
--->--->--->dostuff()


is better than

Code: Select all

        if ( condition1 &&
             condition2    )
            dostuff()


Such tabs should be displayed in a non-obtrusive way, with light colors, so as to not clutter the screen too much while still providing an immediate way of identifying indentation.

Derek
Posts: 2108
Joined: Wed Aug 18, 2010 4:15 am UTC

Re: Tabs vs Spaces

Postby Derek » Sat Sep 26, 2015 5:49 pm UTC

moiraemachy wrote:I have the solution: tabs should be always visible when coding. This way, you can clearly see indentation levels, and not get confused by ifs with multiple lines:

This goes without saying. Does anyone seriously not use visible whitespace when coding these days?

User avatar
Flumble
Yes Man
Posts: 1835
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: Tabs vs Spaces

Postby Flumble » Sat Sep 26, 2015 7:11 pm UTC

I had a really hard time debugging whitespace programs, so I turned it on.

Turns out it's just a shitty language for debugging to begin with.

User avatar
phlip
Restorer of Worlds
Posts: 7536
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Tabs vs Spaces

Postby phlip » Sun Sep 27, 2015 11:27 pm UTC

When I used Notepad++ I had visible whitespace turned on. Since switching to Sublime, I've moved to the mode of "whitespace is visible while selected", which is a bit cleaner, to look at, but still makes it very easy to check all the tabs/spaces are correct...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

User avatar
Thesh
Made to Fuck Dinosaurs
Posts: 5310
Joined: Tue Jan 12, 2010 1:55 am UTC
Location: Colorado

Re: Tabs vs Spaces

Postby Thesh » Sun Sep 27, 2015 11:34 pm UTC

I pretty much only check white space before checking in for stuff I do at home. I'm generally good at staying consistent, so it is usually minimal. At work, things are so bad that I don't even bother trying to fix everything.
Honesty replaced by greed, they gave us the reason to fight and bleed
They try to torch our faith and hope, spit at our presence and detest our goals

User avatar
dimitriye98
Posts: 14
Joined: Sun Jan 27, 2013 12:04 pm UTC
Location: nullptr

Re: Tabs vs Spaces

Postby dimitriye98 » Mon Sep 28, 2015 6:21 am UTC

moiraemachy wrote:I have the solution: tabs should be always visible when coding. This way, you can clearly see indentation levels, and not get confused by ifs with multiple lines:

Code: Select all

--->--->if ( condition1 &&
--->--->     condition2    )
--->--->--->dostuff()


is better than

Code: Select all

        if ( condition1 &&
             condition2    )
            dostuff()


Such tabs should be displayed in a non-obtrusive way, with light colors, so as to not clutter the screen too much while still providing an immediate way of identifying indentation.


Another advantage of tabs, visible indentation makes code so clean to look at. Though I prefer:

Code: Select all

»   »   if ( condition1 &&
»   »        condition2    )
»   »   »   dostuff()

Note the use of a non-standard character to avoid confusion.
Join nomic. It's awesome and fun.

User avatar
Wildcard
Candlestick!
Posts: 251
Joined: Wed Jul 02, 2008 12:42 am UTC
Location: Outside of the box

Re: Tabs vs Spaces

Postby Wildcard » Thu Dec 31, 2015 7:38 am UTC

phlip wrote:Maybe there should be a standard that a tab indents by, like pi spaces or something... so that they just can't be used for alignment...

That is an extremely strange idea...at first I liked it (and I laughed) but looking at it a bit more I think it is reeeeeeally not a good idea.

One personal code/private projects, I generally use two spaces, not tabs. Hitting space twice for indenting isn't really that bad, and makes for very readable code in almost all cases. Plus there is the added benefit that it works anywhere and displays exactly how I typed it. (By "works anywhere" I also mean I can type that way anywhere, even in Notepad.)

For code at work, as another user posted, everything is so screwed up on whitespace anyways that I don't bother too much with how it looks. Or rather, I make it look good, but not necessarily consistent across files—I just follow whatever convention was used in the file I was editing. Unless it's really bad (or unless I'm making a whole bunch of changes to a small file), at which point I'll reindent the whole thing to my own preference.

The official style guide in this case matches my personal preference, which is lucky. :) The main problem is vast quantities of legacy code.

Perhaps someday we'll do a big vast "whitespace fix only" git commit. 8-)
There's no such thing as a funny sig.

quantropy
Posts: 187
Joined: Tue Apr 01, 2008 6:55 pm UTC
Contact:

Re: Tabs vs Spaces

Postby quantropy » Fri Jun 16, 2017 4:00 pm UTC

Computer programmers who use spaces as part of their coding earn $15,370 (£12,000) more per year than those who use tabs, a survey of developers has revealed.

Programmers who use spaces 'paid more'

User avatar
Copper Bezel
Posts: 2406
Joined: Wed Oct 12, 2011 6:35 am UTC
Location: Web exclusive!

Re: Tabs vs Spaces

Postby Copper Bezel » Fri Jun 16, 2017 5:57 pm UTC

Do you think it's like a hair shirt thing, that by making things more difficult for themselves and others, they actually grow to be stronger people?
So much depends upon a red wheel barrow (>= XXII) but it is not going to be installed.

she / her / her

User avatar
flicky1991
Like in Cinderella?
Posts: 563
Joined: Fri Feb 11, 2011 3:36 pm UTC
Location: London

Re: Tabs vs Spaces

Postby flicky1991 » Fri Jun 16, 2017 6:16 pm UTC

No, it's because people who know to use spaces are probably intelligent in other areas too. :P
Discord for Forum Games posters
---
avatar from marionic, edited by adnapemit

User avatar
Xenomortis
Not actually a special flower.
Posts: 1387
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: Tabs vs Spaces

Postby Xenomortis » Fri Jun 16, 2017 7:13 pm UTC

quantropy wrote:
Computer programmers who use spaces as part of their coding earn $15,370 (£12,000) more per year than those who use tabs, a survey of developers has revealed.

Programmers who use spaces 'paid more'

Even when I'm using tabs, I still have spaces in my code.
Maybe they get paid more because they take the time to properly format their code?
Image

User avatar
Koa
Posts: 498
Joined: Mon Dec 12, 2011 1:20 am UTC

Re: Tabs vs Spaces

Postby Koa » Tue Jun 20, 2017 3:35 am UTC

It seems like a survey asking programmers what they use rather than looking at what they end up with after a program likely autoformats, along with other weird questions like cat vs dog, star wars vs star trek, rockstar vs ninja...


Return to “Religious Wars”

Who is online

Users browsing this forum: No registered users and 3 guests