
Developers who use spaces make more money than those who use tabs - edward
https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
======
austenallred
Almost certainly a result of the spaces cabal and the (often unspoken of)
prejudice against tab users. Don't think you make hiring decisions based on
tabs vs spaces? Well you're part of the problem, then.

I'm building an app to help you easily email your congressperson and ask them
to create legislation requiring space/tab equality. This has to stop. Please
consider donating to my Patreon.

~~~
jdc0589
> Don't think you make hiring decisions based on tabs vs spaces?

I actually ask candidates "spaces or tabs?" in every single interview. I don't
really care what the response is in regard to the holy war, and it doesn't
mean anything on its own, but having SOME thought out response can be a GREAT
indicator of how well versed someone is in general.

e.g. I'm going to think way more highly of someone that says "tabs, because
then people can set the indentation render size to whatever they prefer in a
way that doesn't affect other users" way more than someone who says "whatever
my editor sets it to".

Also, fuck spaces. Long live tabs.

~~~
dmix
Does spending time considering the implications of spaces vs tabs really
indicate competence? To me being over-obsessed with minor details might be
either negative or at most neutral value. There are thousands of interesting
programming subjects to initiate a conversation to evaluate competency.

At most it's a matter of what tools you use as well as accepted standards in
the individual programming language's community.

~~~
jdc0589
> Does spending time considering the implications of spaces vs tabs really
> indicate competence?

No, it signifies that you have spent enough time programming in a wide variety
of platforms and with enough other peers to run in to the issue and understand
that it exists.

~~~
davidcbc
It just signifies that someone has worked with enough pedantic developers that
they had to form an opinion on something as insignificant as this, or that
this person is pedantic enough to have a strong opinion on it.

I wouldn't consider the first to be a good indicator of someone's skill as a
developer, and the second would be a good indicator that it was someone I
didn't want to work with, but I'm guessing that's not how you're using it...

~~~
laythea
I agree. This is ridiculous.

------
redm
The reason I use tabs is pretty simple. It's faster to move around only using
the keyboard. It's also faster if I'm changing code that requires
reformatting. Finally, when another developer looks at the code, their IDE
will render the tabs as whatever its set up for, 2 spaces, 4 spaces, etc. In
other words, it adds flexibility.

Brace yourself: I use two spaces after the end of sentences too. [1] I am
quite the rebel.

Modern IDE's (Sublime Text) let you easily convert spaces to tabs (or vice
versa) and intention length of existing code. [2]

[1]
[http://www.slate.com/articles/technology/technology/2011/01/...](http://www.slate.com/articles/technology/technology/2011/01/space_invaders.html)

[2] [https://css-tricks.com/changing-spaces-tabs-sublime-text/](https://css-
tricks.com/changing-spaces-tabs-sublime-text/)

~~~
jinglebells
> Finally, when another developer looks at the code, their IDE will render the
> tabs as whatever its set up for, 2 spaces, 4 spaces, etc. In other words, it
> adds flexibility.

This is exactly why I use tabs and the reason which appears to never get cited
in the holy wars.

People who use spaces want to line up their '=' signs, that's fine, but I
don't believe it's my position to enforce the amount of whitespace another
developer has to use in their editor. It's an accessibility thing, they might
have their font size really large because of eyesight problems in which case 8
spaces is going to make reading the code a lot harder.

The fact that Python's rule used to be 8 spaces, then got changed to 4 thereby
invalidating old code really showed me how shortsighted it is to use a set
number of spaces in a whitespace sensitive language.

~~~
tom_mellior
> This is exactly why I use tabs and the reason which appears to never get
> cited in the holy wars.

I see this cited every time. Unfortunately, it's bogus in practice. Consider:

    
    
        print('some long thing',
              further, arguments)
    

If this is an indented block, you'd have to _indent_ the second line to the
correct depth with tabs, then add exactly six spaces for _alignment_. You
_have_ to mix spaces and tabs, which is never good news. Additionally, if you
try to actually type in the six spaces, editors might take, say, four of them
and group them into a tab. (I have vague memories from a long time ago of
Emacs doing this. I might be wrong.)

If you get this wrong in program parts that are by definition invisible, it
might look good for you and look really bad for others (i.e., the opposite of
the stated goal). In code I see mixing spaces and tabs, the latter tends to be
the case.

~~~
news_to_me
I'm pretty sure there's a circle of hell specifically for those who mix spaces
and tabs.

That being said, this problem and problems like it can be solved simply by not
aligning things visually:

    
    
        print(
            'some long thing',
            further,
            arguments
        )
    

Strictly adhering to indentation and never alignment can make the code a bit
less readable, but conforming to a canonical indentation like this also makes
it easier to reindent, move code around, etc.

I think that's what the argument really comes down to – alignment flexibility
vs display flexibility. It's interesting to see which people generally prefer.

~~~
pera
> I'm pretty sure there's a circle of hell specifically for those who mix
> spaces and tabs.

Could you please clarify why do you consider "tabs for indentation, spaces for
alignment" such a bad practice? I have never read any argument against it.

Alignment itself can be done automatically by any editor that supports smart
tabs.

~~~
lloeki
Simple: it's hell to automate.

My process is as follows:

    
    
        - tabs allow for custom settings
        - tabs need spaces to allow for alignment, because previous
        - automatically deciding what constitutes alignment vs
          indent is a non-trivial problem, highly dependent on the
          language†
        - using spaces throughout is worse theoretically because
          it flattens the theoretical problem but solves impedance
          mismatch
        - therefore I use spaces and am all the merrier in every practical
          use case
        - except for languages who make dash 3 easy (such as Go thanks
          to gofmt)
        - except for projects I have no say in, where I respect the will
          of the maintainers, because conventions among well-behaved
          people matter more than my highly individual opinion. 
    

† to which the usual answer is "but your editor sucks with lang X", well too
bad, I'd rather have pragmatic editor portability than have perfect language
parsing in every editor being a pipe dream I hinge upon.

------
piker
Could it be that a few large, well-compensating employers are shifting the
result? (E.g.,
[https://google.github.io/styleguide/cppguide.html#Spaces_vs....](https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs))

~~~
CydeWeys
Could well be. I know that Google for sure requires spaces, and some cursory
Googling leads me to the believe that Facebook does as well. Does anyone have
information on Amazon, Microsoft, Apple, etc.?

Of course, if all of the top companies are requiring spaces, then there's
probably a reason for that, and its impact on salary data is thus meaningful,
not just a spurious correlation.

~~~
saagarjha
Don't work there, but I know that Apple tends to use spaces for their public-
facing code–I'd expect that their internal code does too.

~~~
CydeWeys
It's sounding like all the top tech companies use space-based indentation. Our
style guide makes some pretty convincing arguments as to why it's better. It
sounds like good developers are either more likely to (a) work at top
companies or (b) search out information on best practices for handling
indentation. Mediocre developers probably just use whatever, which ends up
being tabs a lot of the time.

------
timhwang21
Well, of course. Only companies with fuck-you money can afford the extra bytes
spaces take up versus tabs, so it follows logically that they'd pay their
developers more.

~~~
lhorie
While your comment is obviously meant as a joke, it somehow rings true from my
anecdotal experience.

I'd also like to see an analysis of space-vs-tabs as it relates to operating
systems. Again, from anecdotal experience, it seems spaces are more common for
folks with *nix background who tend to work in product-oriented companies
(i.e. where code is an asset) and tabs are more common with windows folks, who
tend to work on IT (i.e. where code is liability)

~~~
jermaustin1
I'd like to add my own anecdote: Windows development primarily happens on one
vendor's IDE - Microsoft Visual Studio, and where MS leads, Windows-based
developer follow.

Case in point - I use the default Visual Studio settings which are spaces, BUT
they weren't always. I remember as recently as 2008 tabs were the default.

~~~
edoceo
Visual Studio 4-6 (1996-2000) the default was tabs

~~~
azinman2
The good years for Microsoft.. feels like there’s a story there :)

------
inanutshellus
= Why Grown-Ups Don't Use Tabs =

* Joe likes 4-space tabs, I like 2-space tabs, and Jane is old-school with 8-space tabs.

* All goes well until someone aligns something visually, like so:
    
    
        void someNiceMethod(

[tab][tab][tab][tab][space][space]int myParam...);

* Now it aligns perfectly on my machine, looks mostly ok on Joe's machine, and is ON MARS on Jane's machine.

Thus one-or-more of three futures happens:

* Someone implements a code re-formatter into version control

* Someone re-aligns the code, starting the process over again.

* Someone calls a meeting and demands we all switch to spaces

~~~
blktiger
You mean something like this don't you?

    
    
      [tab]void some nice method(int param a,
      [tab]                      int param b
    

So long as you only use tabs for indentation, not alignment, tabs look correct
on _everyone's_ machine. The real problem with tabs is that (some) people are
lazy and do stuff like this:

    
    
      [tab]void some nice method(int param a,
      [tab][tab][tab][space][space]int param b
    

Personally, I think if you work like that you need to learn to be professional
and write code that follows whatever coding standard your organization uses.
If they use tabs, the second example is _not_ following the coding standard.

So whether to prefer tabs or spaces, to me, depends entirely on how much you
can/want to trust your coworkers to follow the coding standards.

Edit:

Or as pointed out below, change your coding style to this:

    
    
      [tab]void some nice method(
      [tab][tab]int param a,
      [tab][tab]int param b

~~~
kentosi
Wait ... you're saying that you should do a tab, and then a whole bunch of
spaces?

What actual benefit does tabbing even get you at that point?

~~~
mikejmoffitt
Respecting indent preferences of others while not breaking the formatting of
that line-split function call.

------
GavinAnderegg
I see a few arguments here which suggest people think tab-users might care
less about their code and/or their fellow coder. As someone who slightly
prefers tabs and abhors mixing of tabs/spaces, I find this frustrating.

I generally prefer tabs because I feel that they're more egalitarian: I like
4-space indentation, but don't want to force that on everyone encountering my
code. Similarly, I find 2-space indentation very hard to parse in most
languages, so I don't want that affecting me if I can get away with it. While
this is possible with spaces and maybe a series of Git hooks, it's trivial
with tabs.

On the other hand, I always use spaces in languages like Python or Ruby where
there are well-codified style standards. I also always show invisible
characters on any editor which allows it, and have cleanup scripts to ensure
that whitespace is standardized across any non-vendor code in the project.

Maybe most tab users don't feel this way? Maybe most aren't as careful/picky
as I am? Maybe tabs are more popular with younger devs? But I feel like tabs
can offer _more_ interoperability than spaces when many coders are working on
the same project when the language/community doesn't strongly specify
whitespace.

~~~
tbabb
Using tabs has the opposite of your intended effect: If there is any text
which is vertically aligned beyond the first indent, then this alignment will
break for anyone who doesn't have your tab width preference. They're then
forced to change their editor settings to view your file in a non-broken way.
I get way more pissed about someone else "forcing their preferences on me"
when this happens than when I run into a tidy, 2-space-indented file.

If you configure your editor to drop spaces when you hit 'tab', then the file
is guaranteed to look the same for everyone, and stops being context-
dependent-- a bad thing for plain text, IMO.

~~~
agrajag
Your issue is why you see people say "tabs for indentation, spaces for
alignment." If you're trying to vertically align text, use tabs to keep it at
the same indentation as the thing you're aligning to, and use spaces to adjust
to vertical alignment.

This will keep the vertical alignment regardless of the preferred width of the
tab.

~~~
tbabb
So for long lines to move an argument over to align with its predecessor on
the previous line, like

    
    
        int f() {
            int someVariableName = myFunctionCall(expr(5),          // <--- line A
                                                  somethingElse(9), // <--- line B
                                                  a_long * expression + involving(multiple.subExprs));
            int d = somethingElse; // <-- line C
        }
    

...you're saying line A is indented with tabs, and line B with spaces? Because
that will misalign if your tab setting isn't the same.

Or are you saying that both A and B are indented with spaces? Then what about
line C, which will misalign with A and B if your tab stop is a different
width?

Or do we indent the entire body of f() with spaces, and then in that case
you're basically using spaces everywhere, which the good idea that sparked
this whole thing?

~~~
simonbw
I think he's saying use tabs on lines A, B, and C up until the indentation
level (the "int"). Then on line B use spaces for all the whitespace from there
until the text is aligned.

    
    
        /*t*/int f() {
        /*tabs*/int someVariableName = myFunctionCall(expr(5),          // <--- line A
        /*tabs*//*--------------spaces--------------*/somethingElse(9), // <--- line B
        /*tabs*//*--------------spaces--------------*/a_long * expression + involving(multiple.subExprs));
        /*tabs*/int d = somethingElse; // <-- line C
        /*t*/}

~~~
Sammi
There's no reason to do this silly mix of tabs and spaces. Just move all
parameters to a newline have have sane consistency everywhere:

    
    
        int f() {
        <tab> someVariableName = myFunctionCall(
        <tab><tab> expr(5),
        <tab><tab> somethingElse(9),
        <tab><tab> a_long * expression + involving(multiple.subExprs)
        <tab> );
        <tab> d = somethingElse;
        }

------
TekMol
This does not mean that _changing_ from tabs to spaces will increase ones
income.

I would expect there simply is a confounding factor that the author did not
look at. Maybe the info is not in the data.

I can imagine that the space/tab choice is related to the "upbringing" of the
developer. Maybe which language or editor they used first in their life.

Or maybe it's related to culture. For example when using IRC, tabs are usually
not used to communicate. Maybe that impacts the general choice of tabs/spaces.

Or maybe more sophisticated users tend to exchange the tab key for something
else:

[https://xkcd.com/1806](https://xkcd.com/1806)

~~~
BoorishBears
If you hit Tab in Notepad and hit save you get a file with tabs.

If you hit Tab in IntelliJ or a related IDE you get a file with spaces.

If you hit Tab in an older version of VS (the kind you'd expect in certain
types of settings where high pay is not usually expected) you get tabs, but in
newer versions you get spaces (with defaults)

~~~
susw
Nah, they all give you tabs once you set them up _correctly_.

~~~
bluejekyll
I set tab to call auto-indent or the language formatter on the code. I
literally hit tab once to insert whatever is the defined standard for the
file. So my single tab key press inserts or removes exactly the right amount
of white space.

It's a holdover from my emacs days; the one thing I could not give up from
emacs...

------
nottorp
Pretty simple: you use spaces because you're aware that there is more than one
IDE/editor in this world and who knows what your code will get opened with
tomorrow.

This means you consider consequences beyond "but it works on my machine" so
you're a better programmer. Ergo, higher salary.

~~~
scrollaway
Almost everyone I know who uses spaces or tabs does so because that's either
the default on their IDE, or for their language. So this holier-than-thou
argument holds less water than the sun.

On the other hand, I find 2-space-indented code unreadable; in fact, 4-space
wide indentation is the only size I find to be readable. I know plenty of
people for whom that isn't the case. Using tabs lets the reader set the
indentation level.

¯\\_(ツ)_/¯

Edit: All the anti-tab arguments I'm reading below boil down to alignment.
Don't align folks; there's good reasons not to align regardless of your indent
style.

~~~
nottorp
Actually they all boil down to 'someone else, or another IDE that you haven't
configured just right, will mess your tabs and make the code hard to read' :)

They're fine for solo projects i guess, if you only ever use one editor.

Edit: Also, in the long run the best thing you can do to your code is to make
it easily readable. You will forget what you did. Not to mention your
colleagues that have never seen it. So time spent aligning parameters to make
code more readable is well spent, if you ask me.

~~~
scrollaway
> _So time spent aligning parameters to make code more readable is well spent,
> if you ask me._

How is this[1] more readable than this[2]?

[1] [https://github.com/HearthSim/python-
hslog/blob/5a6ad9a29a7d4...](https://github.com/HearthSim/python-
hslog/blob/5a6ad9a29a7d46672d563915ecfae74f3bfda94f/hslog/packets.py#L44-L53)

[2]
[https://gist.github.com/jleclanche/ef40058731061e26d218e2a4c...](https://gist.github.com/jleclanche/ef40058731061e26d218e2a4c99099b0)

Let the lines get long enough and the latter is actually quite a bit harder to
read; try to follow the variable all the way to its value and you might
actually jump and be one line off.

I deeply care about readability and code style, that's why I'm replying here
:) And in all the codebases I have read and written, alignment has
consistently been harmful to readability _and_ maintenance.

~~~
swift
When I hear "aligning parameters", I think more of the difference between
this:

    
    
      someFunction(firstParam, secondParam,
        thirdParam, fourthParam);
    

And this:

    
    
      someFunction(firstParam, secondParam,
                   thirdParam, fourthParam);
    

I've always found the second much easier to read, especially when there are
multiple levels of nested expressions, and it's a style that has been
encouraged on every project I've worked on.

I agree that aligning '=' is actively harmful in the example you give, and
that it's harmful in most situations where it's used. I've encountered very
rare instances where it's helpful, though. Sometimes you have a sequence of
values defined by expressions that follow a pattern:

    
    
      enum someEnum {
        FIRST = BASE + MASK & (1 << 0),
        SECOND_VALUE = BASE + MASK & (1 << 1),
        TH = BASE + MASK & (1 << 2)
      }
    

Aligning the expressions can make it more clear what the pattern is and how it
differs from value to value:

    
    
      enum someEnum {
        FIRST        = BASE + MASK & (1 << 0),
        SECOND_VALUE = BASE + MASK & (1 << 1),
        TH           = BASE + MASK & (1 << 2)
      }
    

Often there are other ways to handle the issue, such as hiding the expression
behind a macro or a function call; when that's more readable, that's the way
to go. But in cases where writing the expression explicitly ends up being more
readable, I find alignment to generally be a win in this case.

------
lvoudour
>Developers who use spaces make more money than those who use tabs

Sure, but how many spaces? _grabs popcorn_

~~~
MrCrbll
Where does using vim to insert four Spaces everytime I press tab leave me?

~~~
notheguyouthink
Yea, I'm honestly surprised this is a thing still. I've not thought about the
tab vs spaces "war" in years; because of Vim. I just hit Tab and whatever the
pre-defined standard is, be it tabs or spaces and space count, is used.

Visually I can have it display in my editor of choice _(Kakoune at the
moment)_ however I want.

I guess I'm just saying, I would have thought the most common answer to this
question would be: Whatever my employer / language standards dictate.

~~~
ake1
i'm surprised people manually insert tabs/spaces. vim automatically indents
for me and even if it didn't, formatting the code is one keybind away...

------
andrewfong
I blame whoever decided to make 8 spaces the default tab width on older
systems. Yes, the beauty of tabs is that you can change the defaults and make
one tab show up as whatever you want, but most people don't change the
defaults. And 8 spaces is just too much more often than not.

From the Wikipedia article
([https://en.wikipedia.org/wiki/Tab_key](https://en.wikipedia.org/wiki/Tab_key)):

> A common horizontal tab size of eight characters evolved, despite five
> characters being half an inch and the typical paragraph indentation of the
> time, because as a power of two it was easier to calculate in binary for the
> limited digital electronics available.

Why someone decided to round up to 8 instead of down to a much more sensible 4
spaces is beyond me.

------
Aaargh20318
Tabs vs. spaces. 2 vs. 4 spaces. It's an endless discussion.

We finally compromised and we're using 3 tabs.

~~~
peterbonney
If we would all just agree to set our tab width to 1 space then we could live
in harmony...

~~~
alejohausner
That's a major problem solved. Now all that's left to do is peace in the
middle East.

------
fcanas
A possibility I haven't seen mentioned is that the style guide of their
employer, together with a few employers who pay out-sized salaries (Google,
Amazon, Facebook...) could account for the difference.

~~~
wott
Yes, the only reason to use spaces is because you are forced to because you
work in an organisation that had to force this rule because it employs too
many morons who cannot make the difference between indentation and alignment.

* Large organisation -> pays more.

* Organisation that has power to enforce coding style rules -> pays more.

* Morons -> they are paid more.

------
andrewla
The most confusing thing about this result is that go shows a high level of
space-preferential salary difference. Go programmers who use spaces make ~20k
more (at the median) than developers who don't.

Only, in Go, you don't have a choice -- gofmt enforces tabs only (with spaces
for alignment). So something seems odd there.

~~~
rcthompson
I'm pretty sure the spaces-vs-tabs question was not language-specific, which
means that the interpretation was more like "in languages that do not enforce
a specific style, which do you prefer, tabs or spaces".

------
delegate
Might also be that the space people, being irritatingly pedantic also include
bonuses and/or stock compensation , while the tab people, always lazy and all
over the place, just barfed the first number that came to mind.

The answer, as always, is: lisp with parinfer - makes the whole debate
irrelevant.

~~~
Shorel
A counter answer: C is not lisp, why should it be indented with spaces like
lisp?

------
Androider
If you're in the JS world check out
[https://github.com/prettier/prettier](https://github.com/prettier/prettier)
if you haven't. It's used by some big projects like React, Babel, webpack etc.

Unlike "traditional" formatters, it parses your code into a syntax tree
completely disregarding any original formatting, meaning the output is
entirely consistent. It's pretty liberating to devote zero time to manually
formatting and can make code reviews more constructive and less superficial.
It is what is is, and it's pretty opinionated based on Facebook's code style.
Works great for us, enforced with a git hook.

------
coldcode
I needed a good laugh this morning. But of course this is pretty bogus
relationship. People who drive Teslas make more money than those who drive
Gremlins.

~~~
simias
But there's an actual causation here (you need more money to buy a Tesla). Use
of tabs and salary don't seem to have any relation one way or an other.

My personal guess would be that using spaces is a practical decision and might
be more popular towards older, more experienced devs (who are therefore better
paid).

On paper tabs sounds better, they're "configurable", you should indent with
tabs and align with spaces, yada yada and everything is good in the world.

In practice however it becomes a big mess real quick unless you only work on
projects with very good and perfectionist developers who understand when they
should indent and when they should align and how they should configure their
editors to do the right thing. See for instance the linux kernel codebase, it
looks like arse if you don't use 8-space tabs and the coding style even tells
you to use that value (it shouldn't really matter if tabs were used "right",
except maybe for 80-column limits). So why even bother with tabs in this
situation? Do we really care that much about wasting a few bytes?

Therefore I gave up on tabs a long time ago and tell everybody to just use
spaces in all the projects I maintain.

~~~
thehardsphere
> My personal guess would be that using spaces is a practical decision and
> might be more popular towards older, more experienced devs (who are
> therefore better paid).

They explicitly rejected this explanation after controlling for years of
experience.

~~~
simias
Oh, you're right. My mistake.

That being said I'd be curious to see "years of experience _working in a team_
", because that's really when using tabs starts becoming tricky. If you're
well disciplined and are the only person messing with your codebase the issues
I mentioned in my previous post don't really apply.

~~~
thfuran
I suspect that correlates pretty well with years of experience.

------
andrewSC
Well that settles that! We finally have proof that spaces are superior to
tabs... ;)

~~~
coldtea
It's only proof that using spaces is selling out...

------
Cerium
Of course professionals get paid more, but I'm surprised there are so many tab
users out there! Time to add a new interview question.

~~~
UncleSam
I believe the correct answer to that interview question would be "Follow the
code style as established by the company, or keep it consistent within
existing projects."

~~~
Cerium
Agreed. People who follow the style guide probably earn more than either
spaces or tabs.

------
jmkni
If I'm using an IDE that handles whitespace and indentation am I using spaces
or tabs?

If a tree falls in the forest, etc

------
inanutshellus
If you use tabs, you work for a small team (or by yourself),. If you use
spaces, it's because you're in a "big enough to stop trusting everyone"
environment.

Case closed! :)

~~~
rcthompson
This could be checked if the survey included questions about the number of
people in your office/company.

------
ajnas
The correct way to phrase this is "Developers who makes more money uses (or
they are forced to use) spaces over tab".

Because bigger corps generally set company wide standards on the code
indentation and that more often that not prescribes spaces.

------
tombert
I use spaces because literally every single time I've tried to propose tabs I
get yelled at by someone... I generally prefer tabs, but I prefer having
coworkers that don't complain more.

------
pklausler
Heh, you kids with your spaces and tabs. Real old-schoolers think in terms of
columns 1-5 for the label, 6 for the continuation marker, 7-72 for the code,
and 73-80 for the change number.

------
drblast
There's an obvious conclusion here we're all dancing around.

People who use spaces are just better than those who use tabs.

------
oscarjd74
Developers who use spaces are more likely to lie and boast about their salary.

------
jelder
I've been using prettier.js in my JS projects for a few months and honestly I
can't imagine going back to formatting my own code. It would be like making
all of my own clothes or something. Who has time for that?

The Go community was on to something with gofmt (even if they did decide on
tabs).

~~~
tombert
I tend to agree, but aren't most of the new hot languages whitespace
sensitive? Are there formatters for those kinds of languages?

~~~
IshKebab
No, whitespace-sensitive languages are still generally the exception (except
newlines). In fact I can't think of a new language that is vaguely popular and
whitespace sensitive since Python. I guess there is YAML but that isn't a
programming language and is also a bit mental.

~~~
tombert
Haskell is (slowly)growing in popularity, and F# is whitespace sensitive, and
these are (for better or worse), the only languages I touch nowadays.

I suppose that maybe none of the really popular languages follow this
though...my bad.

~~~
jelder
Ok, here's a question I've been wanting to ask someone steeped in syntactic-
whitespace languages. Do you find that two developers typing the same code
will format it the same way? How much would an auto-formatter change in your
team's code?

~~~
tombert
There has been a bit of friction on that very point...Now we just agree on
"four spaces all over the place".

I know for a fact that an auto-formatter like `gofmt` or something would have
avoided at least one argument, so it would probably would make the code better
in some respects.

That said, I like the whitespace. I like that it forces you to think about how
the code is formatted and it tends to make the code a lot less verbose.

------
mnarayan01
"Indent with tabs, align with spaces" (e.g. [1]) would be my _strong_
preference in a perfect world. In addition to its "ethereal" benefits, some
languages which support HEREDOCs have nice "tab ignoring" versions (e.g. <<-).

That said, in the imperfect world we live in, I always use spaces. "Indent
with tabs, align with spaces" is obviously not rocket science, but its just
too opaque unless you have a _strong_ code review process.

[1]:
[https://dmitryfrank.com/articles/indent_with_tabs_align_with...](https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces)

------
_jal
For more surprising correlations: [http://tylervigen.com/spurious-
correlations](http://tylervigen.com/spurious-correlations)

~~~
alejohausner
One of my favorite sites.

------
Tomis02
I think people got it backwards. Brace yourselves. You don't earn less money
because you use tabs, but instead you use spaces because you earn more money.

When I was working on my own small projects I was using tabs, or tabs combined
with spaces, which yielded me not a lot of money.

Once I started working for a big corporation, the coding standards mandated by
the company meant I could only use spaces, because people couldn't be trusted
to use a nice space/tab combination.

------
Udik
Somehow it doesn't surprise me that much. Software development is ridden with
fads that fastidious, obsessive developers make a point of adopting
enthusiastically (they used to call them "best practices" until somebody even
more fussy came and suggested to call them just "good practices", because "no
practice can be universally best").

These people have a particular gusto in constantly one-upping each other with
the latest good practice; the one that adopts the highest number of good
practices wins. Their constant talk of the latest fad and push for the "right
ways" of doing things usually puts them in positions where they end up
evaluating and hiring new developers (I got interviewed just the other day by
somebody that didn't ask me to design or structure any code, but rather if I
use == or ===).

Some of these are actually excellent developers nonetheless; others will drive
entire teams into rewriting a perfectly working application into a completely
useless mess of a thousand microservices. Endeavour that will end up in their
CV anyway, helping them to find another excellently paid job once it's time to
migrate.

------
heisenbit
We are suffering from space exhaustion. Experienced older programmers known
earning more were able to gobble up spaces way back while they were still
cheap and are now enjoying spreading them around. Younger coders on a budget
have to be stingy with spaces and are forced to use the poor tab substitute.
This leaves the less experience professionals at the mercy of tab expansion by
greybeard hackers. Sad.

------
_Codemonkeyism
How much money do developers make who have no clue and do not care the least
because they use the auto-layout of their IDE?

------
jayvanguard
When you're working in a large company with many developers spaces make more
sense. Large companies generally pay more.

In a perfect world you'd use tabs for semantic indentation and spaces for
stylistic indentation but this is too hard to implement in 100+ person teams
and also can't be automated via an IDE style sheet.

------
mattpavelle
PEP 8 specifically recommends using spaces for Python development. And the
vast majority of software developers I know follow most of PEP 8 for Python
development. [https://www.python.org/dev/peps/pep-0008/#tabs-or-
spaces](https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces)

I'm not a PHP guy (so I'm not sure about this) but it looks like PHP-FIG
suggests it too... [http://www.php-fig.org/psr/psr-2/](http://www.php-
fig.org/psr/psr-2/)

So are we really saying software developers who follow style guides earn more?
That doesn't surprise me. Adhering to guidelines is a good way to work well on
teams and thus become a more valuable team member.

------
Sandman
What I learned from the last chart is that Clojure devs earn the most money
regardless of whether they use spaces or tabs. Being an Elixir programmer also
pays off nicely but for heaven's sake don't use tabs unless you want to earn
only half as much as you could if you used spaces.

------
sroussey
I'd rather see the results for those that don't participate in SO surveys:
those making $200-500k.

~~~
johnsonjo
This may or may not be true, but just FYI the salaries were an optional part
of the survey so those people may have chosen not to give their salary for
some reason or another.

~~~
creepydata
I think the implementation is that those who are high earner don't have
time/desire to participate in SO surveys, not that they are unlikely to state
their income in SO surveys.

------
iamNumber4
Not the be the voice of reason in a sea of crazy; but this is just stupid.
correlation != causation - making an assumption on pay rate vs who uses tabs
and who uses spaces makes my brain hurt thinking about what moron approved
this article.

Set the tab stop to what ever your project/team style guides requires. Tabs to
spaces is just plain stupid. Why on earth would you ignore the x09 character,
a single character that exists for this exact reason, and replace it with
multiple x20 in the file. Just set your tab stop to what you like to look at,
be it 2, 4, or 42 characters. By the way the default is 4 characters for most
editors/IDE's.

vim - :set tabstop=4 vscode - to your settings add the following.
"editor.tabSize": 4

Everyone else's comments are moot!

Debate over.

------
minimaxir
The difference between the salaries of tab-users vs. space-users in David's
report are too close to call, so I added bootstrapped 95% confidence intervals
for the aggregate median salaries (which was easy to do since the code was
open source):
[https://twitter.com/minimaxir/status/875386185350168577](https://twitter.com/minimaxir/status/875386185350168577)

If the 95% confidence intervals for tabs and the 95% confidence intervals for
spaces intersect at a point, there is a possibility for failing to reject the
hypothesis that the difference between the two is nonzero at the _alpha =
0.05_ level. Since there is little overlap in most cases, the original
hypothesis holds.

------
teddyh
I see it’s time to once again present the once-and-for-all _solution_ to this
tabs/spaces mess: Elastic Tabstops!

[http://nickgravgaard.com/elastic-tabstops/](http://nickgravgaard.com/elastic-
tabstops/)

~~~
iainmerrick
Amen, brother! Unfortunately, like fair taxes, truly representative democracy,
and peace in the middle east, this is probably an idea that's doomed to be
forever ahead of its time.

------
midnitewarrior
I use spaces.

Who do I contact for my check?

~~~
lamacase
Submit an expense report to your employer and you'll be reimbursed for the
extra bytes.

------
raquo
I would like to see a similar analysis for gif vs jif pronounciation. We need
to settle this.

~~~
krapp
GIF - Graphics Interchange Format.

Hard G. for _graphics._ Not "jif."

The matter is settled.

Anyone who dissents gets sent to the camps.

------
RawData
Come on, we've known this for years. Do we really need a study to tell us
that? Hell, the only interview question I've asked new hirees since around
2003 is: "do you indent with spaces or tabs". Really cuts through the BS. It's
foolproof!

:-p

------
imron
Ooh, ooh, now compare salaries of vi vs emacs users.

------
jpfed
This by itself disproves the Just World hypothesis.

------
kazinator
[http://www.kylheku.com/cgit/c-snippets/tree/autotab.c](http://www.kylheku.com/cgit/c-snippets/tree/autotab.c)

With this, I instantly conform to how the file is formatted. Is it 3 space
indentation, made with a mixture of 8-tabs and spaces? Autotab will figure it
out, spit out the Vim params, and you're modifying away without causing
spurious diffs in version control.

You have to learn to use Ctrl-T for indent and Ctrl-D for deindent in Vim;
those obey the shiftwidth and generate indentation according to the
shiftwidth, tabsize and expandtab setting.

------
lisper
And developers who use curly braces make more money than the ones who use
parens :-(

------
rdeboo
It's good that their data science team keeps tabs on these important matters.

~~~
johnsonjo
I feel the analysis left no space for discussion.

------
DonHopkins
What if you control for the size of the space bar and the size of the tab key?

~~~
amcca029
also rubber dome vs switch vs topre

------
paulsutter
Is this about whether you set your editor to convert tabs to spaces? (which is
obviously tidier due to inconsistent treatment of tabs)

Or do some people actually use the space bar to indent code? (which is
obviously insane)

~~~
neurotrace
Definitely the former. Anyone who indents there code by slapping the space bar
repeatedly is a monster and should have their hands cut off.

~~~
paulsutter
Then this survey is surely measuring awareness of how editors work. Most code
editors substitute spaces by default.

------
YZF
On IBM mainframe terminals (327X) tabs were used for moving between entry
fields. So it is/was basically impossible to use tabs in text for formatting.
I'm not even sure if EBCDIC has tabs?

I don't really care that much, Go says tabs so whatever. But spaces have the
benefit (or drawback to some) of rendering exactly the same way for everyone
(assuming fixed width fonts, does anyone code with proportional fonts?). Also
I've always got two thumbs on the space bar. And it's much bigger than the tab
key.

So settled then?

------
tmsldd
Well, in a team with a bunch of programmers each with their own preferences is
kind of tedious to talk and enforce a single formatting standard... So, I just
make sure a small script runs #astyle -A2SKnjfUHpk1cn -R _.h_.cpp before their
commits .. and it made my diff look much nicer.. I don't really discuss tabs
or spaces anymore..

I never thought that such styling would really matter much ... I wonder how
much a developer using a beautifier earns in average..

Anyhow, statistics sometimes brings up some weird conclusions.

------
greyfox
Doesnt using spaces to indent code waste a lot of time? I mean sure if you're
only indenting once, it takes a few extra key presses to make 1 tab worth of
space bar clicks but if your code gets really deep, then you're talking about
wasting a lot of time hitting the space bar key per indent PER line...each
subsequent line of indented code doubles the amount of space bar clicks...

Am i missing something here? this sounds really dumb, as tabs make the most
sense, and it appears use less memory as well.

~~~
dbh937
Most IDEs can map the tab key to insert a certain number of spaces.

~~~
zerocrates
Pretty much any text editor beyond Notepad can, for that matter.

------
aetherspawn
And here I was, thinking the title meant browser tabs vs OSX Spaces.

~~~
matt_lo
you weren't the only one :P

------
animex
They can bill for that extra keypress time. Makes sense. Tab developers
deliver projects on-time and under-budget. Space Developers over-charge,
deliver late, but make more money. ;-)

------
nailer
As someone who switched preferences: i _used_ to hate tabs

Then somebody asked me why. The answer was that Sun Solaris was a crappy
operating system which would fail to boot if you used tabs in files like
/etc/vfstab.

For some odd reason, I carried around a weird bias about tabs rather than
regarding Sun as being shitty.

I worked somewhere where a bunch of folks preferred four spaces (because they
came from Python), others two (because they came from JS). Use tabs, set your
preferred tab size, boom, everyone gets along.

------
oftenwrong
I wish editors handled indentation preferences intelligently. I prefer my
indentations to appear 2-columns wide. I want to be able to open my editor,
have everything appear as if it is 2-column-tab-indented while I work on it,
but have it automatically written back to use the original indentation scheme
of the file. Obviously there would be some ambiguous cases, which is
acceptable.

I use vim with vim-sleuth now. If anybody knows how I can achieve what I
described above in vim, please tell me how.

------
sqeaky
In the past ten years I have had 7 different development positions (and a few
IT positions), I have never been at a place that used tabs. Ruby, C, C++, php,
C#, SQL were the languages used and there positions were scattered across
medical, Retail/Wholesale, Government/DoD.

That someone with this many different types of experience can have
accidentally avoided encountering whole class of people and their code, really
puts into perspective how small the experience of any 1 person is.

------
drumttocs8
Why didn't he test by age? Age is likely the variable most linked to salary.
Older developers didn't use fancy IDEs- just a simple text editor is all you
really need.

------
gthtjtkt
I don't understand how people can work with spaces. I had to reformat a
colleague's query the other day and it was infuriating because all the tabs
had somehow been converted to spaces. I had to edit it line by line instead of
being able to easily shift entire blocks in either direction.

Do Visual Studio and SSMS support the space equivalent of "Select X rows and
tab them all at once"? I just tried now and all the code is wiped out,
replaced by a single space.

~~~
kemitche
Most editors I've used will let you adjust indentation with the tab key in
that situation. (The indentation still ends up as spaces, of course)

I do this on a daily basis to adjust my indentation in json/yaml files.

------
rcthompson
In terms of potential explanatory covariates, I think preferred editor/IDE
would be one of the most likely to explain the trend, since different editors
will have different defaults. The survey has this information, so someone
could test this. It would probably help to group the editors by their default
setting. I think you might need a mixed model with editor as a random effect
to include both default setting and preferred editor in the same model.

------
iainmerrick
In case people aren't aware of it (I only found it recently), check out
EditorConfig: [http://editorconfig.org](http://editorconfig.org)

It lets you check in an .editorconfig file that specifies whether your project
uses spaces or tabs. And a bunch of editors and IDEs already have built-in
support for it!

Doesn't solve the holy wars, but it can sure help reduce the friction.

------
JepZ
Well, pretty biased article. One example:

"There were 28,657 survey respondents who provided an answer to tabs versus
spaces and who considered themselves a professional developer (as opposed to a
student or former programmer). Within this group, 40.7% use tabs and 41.8% use
spaces"

Without filtering to the 'professional developers', meaning overall, there are
more tab users (32% vs. 28%).

------
tracker1
package.json

    
    
        ...
        "format": "prettier-eslint --write --trailing-comma es5 --single-quote true \"_src/**/*.js\"",
        "lint": "eslint \"_src/**/*.js\"",
        "precommit": "npm run format && npm run lint"
        ...
    

problem solved...

------
om2
It looks like they didn't correct for multiple comparisons. Given the number
of questions on the survey, there was bound to be at least one surprising
correlation that looks significant without correction.

(Am I wrong? I would hope a Data Scientist would know a basic thing like this,
but I don't know R so I can't tell for sure from their code.)

------
srett
It's 2017, that wage gap is outrageous and discriminating!

...but at least with tabs everyone can adjust the gap size to their liking. :>

------
TACIXAT
I just like to force my preferences on other people, so I use spaces. You like
8 width tabs? Too bad, you get 4 spaces.

~~~
tripzilch
Exactly. I'd use tabs if I wanted other people to be able to control what my
code looks like. Ugh. So I use spaces.

------
Dove
That doesn't seem like a mystery to me. The argument in favor of tabs boils
down to "tab damage won't happen". The argument in favor of spaces boils down
to "tab damage will happen". I know which of those two philosophies I would
prefer to have in charge of important things.

------
rectang
As a spaces user, I have to acknowledge that I get irritated when I open a
document with tabs and the formatting is messed up thanks to tab setting
mismatches.

Is it possible that tab-aversive people making hiring decisions act on their
aversions (consciously or unconsciously), while tab-friendly hiring managers
do not?

~~~
kutkloon7
Can you explain that? I can't see how different tab settings would mess up
formatting. Unless you use tabs to match the position of things over two
different lines (which is abusing tabs), or mix spaces and tabs, tabs should
work fine.

~~~
nf05papsjfVbc
It is usually frowned upon when people's excuse is "You are holding it wrong".

~~~
kutkloon7
?

------
tripzilch
I strictly use spaces for indentation (and alignment never) but I don't _hate_
on tabs, they have a right to live in my code. So I like to sometimes place a
sprinkle of 2 or 3 tabs at the end of lines where no one will notice them
probably anyway.

I think it's the best of both worlds, really.

------
tzury
Software developer must come to a flexible mindset in order to succeed.

Use whatever's right for you! And, if you come to a workplace where there are
"rules" about that, try to obey them.

Never take part in any of those wars of Tabs vs Spaces, VIM vs Emacs vs
Sublime vs whatever.

Spend time on writing more tests instead!

~~~
mjevans
If you have rules about formatting that should be part of automated formatting
for the code which should be part of the standard (hopefully automated) check-
in process.

~~~
tzury
right on!

------
Pitarou
My apologies to all you tab lovers, but I suspect that preferring spaces is a
proxy for experience.

------
nikolay
A tab and a space have different semantics. Don't dumb things down, please! In
Bash, for example, you need tabs for indented heredocs to avoid redundant
leading spaces, which could be problematic in some cases - that's why I always
use tabs with Bash.

------
tripzilch
Of course you're gonna make less if you let other people control what your
code looks like.

------
weddpros
Developers who use spaces cost more than those who use tabs...

Now that's a fact for your next job interview!

------
eloone
I just find this thread funny [http://machinesaredigging.com/2017/06/15/tab-
vs-space-users-...](http://machinesaredigging.com/2017/06/15/tab-vs-space-
users-storm/)

------
samblr
In your editor, select option to convert tabs to spaces - you turn rich even
using tab(key)!

------
anonymousiam
I believe the tool 'indent' was created in part to end this "holy war". I just
checked my system (a relatively new LinuxMint install) and found that 'indent'
is not installed by default, but it is in the repo.

------
dlanouette
I'm going to go reformat all the files in my companies repo and wait for the
raise.

------
ceocoder
That's it. I'm heading back home to get my bag of pitchforks, tar and
feathers. See you back at the playground in an hour.

I mean how are we to achieve world peace when we still have people using and
being awarded for wasting precious bytes.

------
aiyodev
Alternative headline: Developers who use spaces more likely to lie about their
income

------
ianai
This sounds like self selection bias. Only 12k of 28k respondents included
their income. If you decrease a sample artificially then the resulting
statistics are all suspect. (I stopped reading once I saw the attrition rate)

------
tripzilch
> Put another way, using spaces instead of tabs was worth as much as an extra
> 2.4 years of experience.

It's because they get more keystrokes in!

Depending on your tab/indent settings you might get as much as 4x or even 8x
the XP by using spaces.

------
idlemind
What's going on with the salary disparity between US ($100k) and UK ($50k)?

~~~
pcurve
I know nobody wants to hear this, but developers in the U.S. are overpaid
compared to their peers in the rest of the world. We should count our
blessings.

~~~
richardknop
In UK best developers work as contractors and make on par with US peers. This
is not accounted for in most data as they look at permanent job salaries in UK
which are very low.

------
bdamm
The number of respondents who included salary is almost half of the overall
sample size. So it could just be that developers who use tabs make more and
are less likely to hand out their salary.

------
thatwebdude
Oh boy. Editorconfig and I'm done. I sincerely don't care.

------
mcculley
The tab character, ASCII code 9, should not appear in source code. What
happens when you press the tab key to make the proper number of spaces appear
is between you and your editor.

------
bitwize
Sexy languages, like Python or Node, encourage the use of spaces.

Tabs are more often used in languages like C and C++ which are more
traditional and pay less despite being more technical.

------
Nomentatus
I'm guessing developers with more relatives on the Autism spectrum prefer
spaces to get exactly the look they like, and are better (more picayune)
programmers.

------
Radle
I'd assume that tabs vs spaces is a localized argument. Thus in an
area/company area and company there's higher salary and spaces are the
default.

------
pcunite
This is the danger of statistical analysis, where you determine that drinking
from lead laden dinnerware means you're a part of high society.

Indeed, it does means that.

------
minusSeven
Correlation is not equal Causation. How in the hell are people taking this
seriously? Also there is no reason given in the article to explain why it is
so.

------
willand31
This is because people who use spaces have to use Stack Overflow more often,
so there were more developers who use spaces when SO did their 2017 survey.

------
altern8tif
I wonder how many man-hours (and by extension, wages) has been spent debating
this potentially world-changing issue.

The internets giveth, and the internets taketh away.

------
dkhenry
Good thing things like YAML have now trained me to only use spaces. Also for
those looking to make a quick buck, emacs has `c-x h m-x untabify` enjoy

~~~
yxhuvud

       ;; if indent-tabs-mode is off, untabify before saving
       (add-hook 'write-file-hooks
                  (lambda () (if (not indent-tabs-mode)
                                 (untabify (point-min) (point-max)))
                    nil))
    

is pretty sweet if you are lazy.

------
TallGuyShort
And Silicon Valley becomes slightly less satirical.

------
jv22222
That's the median. I'd be really interested to see if that rings true when
only taking the top 10% of earners into account.

~~~
tripzilch
I'd be much more interested in reading about modal income.

------
winstonewert
A simple explanation that occours to me:

Many of those who answered tabs are actually using an IDE which inserts spaces
when they push tab. They believe they are using tabs, because they've never
realized that this is going on. People under that misapprehrension are likely
to be less skilled.

Additionally, if a coder, is in fact, deliberately choosing the use tabs, they
are going against the majority opion of coders and almost all style guides.
That attitude might be correlated with lesser income.

------
mattmanser
What surprises me most about those graphs is that US developers are paid twice
as much as Canadian, UK or German developers.

------
guilhas
I prefer tabs, but use spaces. We use VisualStudio which has spaces by
default, so the company just adopted as standard.

------
flipp3r
Jetbrains product users make more money? ;^)

~~~
treehau5
How else do you think they can afford to pay for the licenses?

~~~
pc86
The $89 a year is not exactly breaking the bank.

~~~
clavalle
The time savings alone probably paid for itself in two days of use.

------
panzer_wyrm
But which write better code? If space guys are Baby Metal and tab users
Meshuggah this would leave thing inconclusive

------
solotronics
I reconfigured my linux to insert 4 spaces when I press tab.. am I doing it
wrong by using the tab key for spaces?

------
richardknop
Golang uses tabs for indentation and Go developer jobs have good salaries but
then again this might be an outlier.

~~~
marcus_holmes
they controlled for language too, and didn't cite Go as an outlier

------
madiathomas
Plot twist: Dev Managers tracks your productivity by number of kepresses you
make per day. The more the better.

------
vortico
This topic is the most tired debate ever. I'd rather talk about _politics_
than indentation styles.

~~~
qb45
We need laws to settle this issue once and for all. Even disregarding how
boring these Internet disputes are, we can no longer ignore the fact that all
these coding style guides, whitespace normalization patches and python bugs
caused by mixing tabs with spaces are costing our economy real money in lost
engineer productivity and decreased reliability of software products.
Programmers of all countries, unite!

------
delinka
I suppose, then, that this pre-commit hook I have for tabs <-> spaces
conversion is borderline fraud.

------
BinaryIdiot
If one uses an editor which replaces tab key presses with spaces, is one using
tabs or spaces or both?

~~~
tripzilch
The discussion was never about what keys you personally press to edit your
code (nobody cares enough to wage a holy war over), but what other people have
to deal with when reading your code.

------
daveheq
So how much per keypress are companies paying extra just for their developers
to indent with spaces?

------
kalleboo
Am I alone in not even knowing what I use? I use the formatting standard that
my IDE enforces.

~~~
TorKlingberg
Use the arrow keys to move around a bit. Does it move once space at a time or
jump?

~~~
fao_
This depends on how the editor works with spaces. it could have a special rule
for '^\s*'

------
my_ghola
I only use tabs in my Makefiles.

~~~
coffeeaddicted
Makefiles are the reason I use tabs everywhere. No need to switch mentally -
or switch editor settings. But I'm rather poor ... maybe Makefile are the
reasons for that? I need that correlation betweenn Makefile writers and
income!

------
vbezhenar
But how many spaces for indentation yields more profit? That's the next
question.

------
tripzilch
The real question is, if correlation does not imply causation, _then what
does?_

------
rosstex
Obviously, it's because programmers who use spaces work four times as hard.

------
11thEarlOfMar
I so wanted to post an ad for a Blood Boy in this month's Who Is Hiring.

------
austincheney
How is this even a thing when there are code beautifiers that do a great job?

------
exabrial
Tabs are for people that use soft wrap.

Spaces are for people still using 80 column monitors.

------
kbenson
Of course. That's why I vote spaces in every presidential election.

------
kaonashi
Anything more than two spaces is a waste of precious screen real-estate.

------
ajaimk
Doesn't Go & gofmt pretty much not allow for the use of spaces?

------
toast0
Clearly, you have to pay people more to use spaces, free market at work.

------
maxsavin
Perhaps programmers who use spaces also participate in satanic rituals

------
pasbesoin
Finally, a clear cut financial answer to this schism!

You tabbers are costing me money!

------
iLemming
Devs who use Vim and Emacs make more money than those who use IDEs

------
Shorel
As I put in another comment:

Use and respect .editorconfig files in your projects.

------
lotsoflumens
OK - now that's out of the way.

Let's move on to ASCII vs Unicode ....

------
linkmotif
Just asked myself, "It's not April 1st, is it?"

------
Wheaties466
Maybe it just means python programmers are paid more /s

------
jasonkostempski
I want all my characters to be the same width, except one.

------
z3t4
Could be those using spaces all live in Silicon Valley.

------
josephagoss
What about using tabs that render as spaces in the IDE?

------
mcs_
I have to stop converting spaces with tab in sublime

------
valuearb
Money isn't everything. Tabs live forever!

------
gmarx
Being honest, I don't know if I use tabs or spaces. My IDE mostly does it when
I hit return and I reformat it every so often.

Are you guys all programming in vi or notepad or something?

------
rubayeet
Some men just want to watch the world burn.

------
keymone
wow, clojure is really well-paying language

~~~
slowmovintarget
It is interesting to see that it is a well-paying language, according to that
chart, regardless of whether one uses tabs or spaces.

I suspect this has more to do with the sorts of programmers who work with
Clojure, though.

~~~
GFischer
I suspect it's geographic. That happened to Ruby in the past, these languages
get traction first in Silicon Valley (highest paid area for software) and then
spread out.

It's also not very mainstream. Stuff like Java or C# has millions of
developers in lower-paying countries that bring their averages down (I'm one
of them :) ).

------
collyw
Pay should be deducted for using tabs! :)

------
asab
A metalevel flame war on spaces vs tabs..

------
spongeb00b
Yeah, but which programmers are happier.

------
watwut
Possible explanation: Tab vs space is likely to be correlated with technology
(C vs Java vs JavaScript) and different technologies pay differently.

~~~
apapli
I thought that too, but further down the article it seemed that wasn't the
case.

I'd like to see the split of age vs tabs and spaces. I'm with a few other
people that may say experienced programmers prefer spaces as it causes them
less formatting issues over time when working in larger teams or on differing
IDEs - and experience pays more.

------
tempodox
I use spaces so I can make more money.

------
fergie
Vindication.

------
jmnicolas
Maybe it's an age thing : older devs tend to prefer spaces and are usually
more paid than young devs.

~~~
thehardsphere
They explicitly rejected this explanation after controlling for years of
experience.

~~~
tpolm
age != years of experience

~~~
thehardsphere
That statement is correct, yet the commenter mentioned two variables who are
caused by years of experience and are only correlated with age.

------
red2awn
What about soft tabs?

------
emodendroket
Well that settles it.

------
Clubber
Developers who use the space bar aren't real automaters. :)

------
fahadkhan
Oh no! Someone started the Tabs vs Spaces holy war on HN again.

------
moomin
Remind me what Facebook and Google use :)

~~~
ionised
I don't know the anwer to that, but why would it matter?

~~~
moomin
Because they pay well, employ a large number of people and could potentially
be the confounding factor.

------
mmariani
Aaa

------
known
Python?

------
howscrewedami
correlation != causation

~~~
icebraining
Which is exactly what the article says.

~~~
wlesieutre
> The model estimated that using spaces instead of tabs leads to a 8.6% higher
> salary (confidence interval (6%, 10.4%), p-value < 10^-10). (By predicting
> the logarithm of the salary, we were able to estimate the % change each
> factor contributed to a salary rather than the dollar amount). Put another
> way, using spaces instead of tabs was worth as much as an extra 2.4 years of
> experience.

Maybe I'm not up on my statistics lingo, but saying "using spaces instead of
tabs leads to a higher salary" sounds much more causal than "using spaces
instead of tabs is correlated with a higher salary."

If they're going to say something leads to something else, I don't see how
that one's justified over the reverse: "having a higher salary leads to using
spaces." Isn't that's just as valid a conclusion from the data?

~~~
icebraining
Yes, the word "leads" was an unfortunate choice.

------
justforFranz
WOW! THANKS DEEP LEARNING!

------
Twirrim
I used to work at a place where a huge argument occurred between staff,
fighting over tabs vs spaces. It wasn't mentioned in the company code style.

Eventually leadership got annoyed at the amount of time developers were
wasting punting code reviews back and forth over this silly nonsense, let
alone the loud altercations around the office. Who ever could have guessed
that developers would be such an opinionated bunch?

So they mandated spaces, and all was peaceful in the office.

For about a day.

Naively they put something along the lines of "spaces are to be used for
indentation" in the code style document, but failed to specify _how_ _many_
spaces.

So the new arguments started up amongst the office. 3 spaces or 4? Whoever
could have guessed that a number of developers were actually belligerent types
who would go out of their way to find _something_ to argue about, and also
stubborn? Such a rare trait in developers.

So the arguments raged again, and eventually management decided they'd had
enough. After all the fuss and grumbling over making an arbitrary decision on
the tabs vs spaces debate, they decided this time to be democratic.

They scheduled a big all-hands meeting for the developers, and tolerating no
interruptions, outlined that a binding vote was going to be taken. The code
style document would be updated to reflect the democratic consensus, and also
warning that future arguments on any other points would result in verbal
warnings, and potentially dismissal.

With the software development managers standing at the front each to
independently do the count, they asked all developers in favour of 3 spaces to
raise their right hand, and all developers in favour of 4 spaces to raise
their left.

The count started, but soon the managers realised that with all the raised
hands, they couldn't see the fours for the threes.

~~~
guelo
The fours for the threes? That's not funny at all. Not much of a payoff for
such a long joke.

~~~
koko775
It's a pun. Couldn't see the forest for the trees -> paid too much attention
to a small thing without looking at the biggest picture.

------
yAnonymous
Tabs were the default for a long time, so it can be argued that developers who
use spaces make a conscious decision and care about clean code more than tab
users who just go along with the default. I'm not arguing tabs vs spaces here,
but exploring systems and caring about good organization.

If you care about clean code, being orderly and organized probably extends to
other areas, too, and that helps you make more money.

In my experience, developers who mostly use default settings are often
unorganized and easily confused. They also know very little about the systems
they are working with, because everything outside their IDE doesn't interest
them.

I'd also bet that many tab users had to check what they use, because they
didn't know or care.

tl;dr: Developers who change the settings are more dedicated to their job.

------
dingo_bat
On a somewhat related note, if I had to ask a Genie for a wish, I'd ask him to
magically convert all tabs in all codebases to spaces and make git forget the
commit.

~~~
IshKebab
Apart from the fact that you are doing it the wrong way around, that would
actually be a really useful git command.

I.e. you fix the whitespace in your files, then rewrite history as if it was
always that way. Then you don't get git blame showing you whitespace-only
commits.

(Yes I know there is an _option_ to ignore whitespace in git blame, but it
isn't on by default so it is useless everywhere except the command line.)

------
kutkloon7
"The model estimated that using spaces instead of tabs leads to a 8.6% higher
salary".

So the model actually predicts causality, instead of correlation? That's
amazing. I'll start using spaces instead of tabs today and I will ask for a
8.6% raise.

According to this model, I should get it!

~~~
Clubber
Join a basketball team, you'll be taller too!

------
crpatino
As long as we are sharing crazy theories...

Boring corporations like boring spaces, and have to pay big, boring salaries
to get any talent at all.

On the other hand, cool code slingers may or may not prefer tabs out of
personal idiosyncracies, but as long as all of them get shortchanged by the
VCs and/or startup founders...

------
mtgx
Ugh, could it be because those who use tabs are from a younger/less
experienced/less paid generation that have learned to program with tabs, as
opposed to programming veterans who were used to spaces?

I don't think the fact that you use spaces automatically makes you a richer
programmer.

------
gcb0
the only right answer for "tabs vs space" question is "i put a modeline
comment with the project accepted style on all files I touch. And that style
guide better say tabs" :)

------
kmicklas
The real answer here is, text is a bad data structure.

------
ebbv
Of course they do because they are pig headed ignoramuses who are insist on
getting their way in spite of all evidence that they're wrong. So of course
they are good at getting raises. ;)

------
Scarbutt
Developers who use spaces are more pragmatic, hence more money.

------
jorgeleo
Repeat after me:

Correlation does not imply causation

Correlation does not imply causation

Correlation does not imply causation

------
SurrealSoul
File > Preferences > User Settings > Tabs place two spaces

------
omginternets
First thought: perhaps languages that officially recommend spaces (e.g.
Python) predict higher salaries compared to those that recommend tabs (e.g.
Go)?

~~~
jwilk
They did control for the programming language.

------
IanDrake
Older people use spaces. Older people make more money because they are further
along in their career. Thus it only appears spaces make more than tabs, when
it's really about age.

Just a guess.

~~~
barrkel
The graph has experience as its y axis.

~~~
tpolm
years of experience != age.

~~~
barrkel
They are, however, correlated :)

