Developers Who Use Spaces Make More Money Than Those Who Use Tabs
40 replies, posted
[url]https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/[/url]
[quote]Do you use tabs or spaces for code indentation?
This is a bit of a “holy war” among software developers; one that’s been the subject of many debates and in-jokes. I use spaces, but I never thought it was particularly important. But today we’re releasing the raw data behind the Stack Overflow 2017 Developer Survey, and some analysis suggests this choice matters more than I expected.
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 (with 17.5% using both). Of them, 12,426 also provided their salary.
Analyzing the data leads us to an interesting conclusion. [B]Coders who use spaces for indentation make more money than ones who use tabs, even if they have the same amount of experience[/B]:
[...]
The model estimated that using spaces instead of tabs leads to a [B]8.6% higher salary[/B] (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 [B]worth as much as an extra 2.4 years of experience[/B].
[/quote]
[t]https://zgab33vy595fw5zq-zippykid.netdna-ssl.com/wp-content/uploads/2017/06/salary_graph-1-1024x731.png[/t]
[b][I]Discuss.[/I][/b]
Better to use tabs and be healthy than use spaces and be sickly.
I can only guess this is because most IDEs and text editors default to indenting with spaces, and the people who just want/have to get their code working quickly and don't care as much about readability don't bother changing many settings in general.
but it also depends on whether the survey respondents interpreted it as 'i use the tab key but that puts spaces and so i'm putting down spaces' or 'i use the tab key so im putting down tab' even if their IDE or whatever replaces it with spaces aswell
[QUOTE=343N;52367741]but it also depends on whether the survey respondents interpreted it as 'i use the tab key but that puts spaces and so i'm putting down spaces' or 'i use the tab key so im putting down tab' even if their IDE or whatever replaces it with spaces aswell[/QUOTE]
I can only assume it's 'I use the space key' - I use tabs but I only recently found out that one of the IDEs I use actually four inserts spaces for certain file types.
if i use both, does that mean i make double the money?
oh wait, shit
[QUOTE=tschumann;52368188]I can only assume it's 'I use the space key' - I use tabs but I only recently found out that one of the IDEs I use actually four inserts spaces for certain file types.[/QUOTE]
Every editor or IDE worth its salt lets you set tab width and whether to consistently use tabs or spaces for both automatic and manual indentation and (if available) indent guides. I don't think anybody indents using the space bar manually (except for more fine-grained indentation / alignment on the last level). Then again, I also thought everybody knew that.
[QUOTE=DrTaxi;52368681]Every editor or IDE worth its salt lets you set tab width and whether to consistently use tabs or spaces for both automatic and manual indentation and (if available) indent guides. I don't think anybody indents using the space bar manually (except for more fine-grained indentation / alignment on the last level). Then again, I also thought everybody knew that.[/QUOTE]
I agree. Possibly the tabs vs spaces scene from Silicon Valley has tainted my view of reality.
Another hit piece article by those spaces peddling hacks.
Wonder what the correlation is of developers who use either and what kind of products they develop. Pretty sure it's common in e.g. Javascript to use spaces and in e.g. C# or C++ to use tabs.
[QUOTE=Asgard;52370304]Wonder what the correlation is of developers who use either and what kind of products they develop. Pretty sure it's common in e.g. Javascript to use spaces and in e.g. C# or C++ to use tabs.[/QUOTE]
See the article, there's a chart for tabs/spaces pay gap per language. Spaces win every time.
There's also the raw data in case you want to do your own analysis.
Programmers who use spaces are more insecure = more likely to lie about their salary. Everyone who said they used spaces in this survey proberbly don't even have jobs considering their filthy practices.
[QUOTE=Asgard;52370304]Wonder what the correlation is of developers who use either and what kind of products they develop. Pretty sure it's common in e.g. Javascript to use spaces and in e.g. C# or C++ to use tabs.[/QUOTE]
C# at work, use spaces. I still use "Tab", but it inserts 4 spaces instead of a tab char, as does everyone else at my work.
I literally cannot understand why someone would ever use spaces. Visual Studio does spaces by default and I fucking hate it.
[QUOTE=proboardslol;52372093]I literally cannot understand why someone would ever use spaces. Visual Studio does spaces by default and I fucking hate it.[/QUOTE]
because they show up differently on different text editors and viewers
there is no standard on how much whitespace tabs take up, and more often than not, way too much
you can freely choose how many spaces you want to use in your code -> you can choose how much whitespace you want your indentation to take up
there is no such freedom when it comes to tabs
as far as I see, there is nothing to gain from using tabs
[QUOTE=NotMeh;52372131]because they show up differently on different text editors and viewers
there is no standard on how much whitespace tabs take up, and more often than not, way too much
you can freely choose how many spaces you want to use in your code -> you can choose how much whitespace you want your indentation to take up
there is no such freedom when it comes to tabs
as far as I see, there is nothing to gain from using tabs[/QUOTE]
Makes code easier to edit. 3 tabs -> 3 backspaces vs. 3 tabs -> 12 backspaces.
Afaik any good text editor should let you edit how long a tab is. Spaces just make it annoying to edit code.
You shouldn't even have to do 3 backspaces for 3 tabs. You should be able to remove all the whitespace in any region with one hotkey. If you're in VS you can CTRL+SHIFT+ARROW to highlight all the way to a character that isn't whitespace. If you're in emacs you can even have it better.
[QUOTE=proboardslol;52372196]Makes code easier to edit. 3 tabs -> 3 backspaces vs. 3 tabs -> 12 backspaces.
Afaik any good text editor should let you edit how long a tab is. Spaces just make it annoying to edit code.[/QUOTE]
Shift+Tab's for dedenting, not Backspace.
Many editors (VS included) will dedent to whatever the previous indentation level is, regardless of what characters they are configured to insert.
Also lets you dedent a selection or, in some editors, a line (without having to move the cursor to the beginning).
[editline]18th June 2017[/editline]
[QUOTE=Proclivitas;52372444]You shouldn't even have to do 3 backspaces for 3 tabs. You should be able to remove all the whitespace in any region with one hotkey. If you're in VS you can CTRL+SHIFT+ARROW to highlight all the way to a character that isn't whitespace. If you're in emacs you can even have it better.[/QUOTE]
Ctrl+Backspace deletes whatever you'd select with Ctrl+Shift+Left, without having to select it first.
[QUOTE=DrTaxi;52372462]Shift+Tab's for dedenting, not Backspace.
Many editors (VS included) will dedent to whatever the previous indentation level is, regardless of what characters they are configured to insert.
Also lets you dedent a selection or, in some editors, a line (without having to move the cursor to the beginning).
[editline]18th June 2017[/editline]
Ctrl+Backspace deletes whatever you'd select with Ctrl+Shift+Left, without having to select it first.[/QUOTE]
You would have to retype whatever get's deleted by CTRL+Backspace, but with CTRL+SHIFT+ARROW you can move the selection one char forward or backward and then delete without having retype; it becomes mechanical. Much easier in emacs though..
[QUOTE=proboardslol;52372093]I literally cannot understand why someone would ever use spaces. Visual Studio does spaces by default and I fucking hate it.[/QUOTE]
Does it? It's always done tabs for me and I've never configured anything.
[QUOTE=NotMeh;52372131]because they show up differently on different text editors and viewers[/QUOTE]
adjust tab width
problem solved
[QUOTE=WolfOfWallSt;52373645]adjust tab width
problem solved[/QUOTE]
[QUOTE=proboardslol;52372196]Makes code easier to edit. 3 tabs -> 3 backspaces vs. 3 tabs -> 12 backspaces.
Afaik any good text editor should let you edit how long a tab is. Spaces just make it annoying to edit code.[/QUOTE]
a lot of text editors aren't gonna support this feature, and if they already do, then they can surely let you adjust how much of an effect an backspace will have in case of whitespace
which means you can get the exact same effect with spaces
any kind of code web viewer (usually git browser) isn't gonna let you play with tab sizes
[QUOTE=tschumann;52372771]Does it? It's always done tabs for me and I've never configured anything.[/QUOTE]
It may have been someone at my company doing it. We all share one license so the settings for one copy get applied to all. I always sign out of the account so that I don't have to use my coworkers terrible color scheme
[QUOTE=NotMeh;52374084]a lot of text editors aren't gonna support this feature, and if they already do, then they can surely let you adjust how much of an effect an backspace will have in case of whitespace
which means you can get the exact same effect with spaces[/QUOTE]
Name [I]one[/I] text editor that doesn't support this that people actually use for programming.
[QUOTE]any kind of code web viewer (usually git browser) isn't gonna let you play with tab sizes[/QUOTE]
[img]http://i.imgur.com/IGcGDgM.png[/img]
[QUOTE=DrTaxi;52374228]Name [I]one[/I] text editor that doesn't support this that people actually use for programming.
[/QUOTE]
Even Emacs can change tab size.
I hope people aren't using Notepad.exe
Sure it's simple, but oh my God it even lacks full CLRF options
[QUOTE=DrTaxi;52374228]Name [I]one[/I] text editor that doesn't support this that people actually use for programming.
[/QUOTE]
seen people unironically use Notepad
but there's older stuff like Far Manager, a Windows version of Midnight Commander
besides that - don't you think it's quite a pain in the bum having to adjust tab size in every single editor and viewer just to make tabs semi-useable?
I've yet to read what I'd actually gain from using tabs
[QUOTE=NotMeh;52374519]seen people unironically use Notepad
but there's older stuff like Far Manager, a Windows version of Midnight Commander[/QUOTE]
I'd say if whatever editor you're using doesn't let you specify indent behaviour, you're already doing it wrong.
[QUOTE]besides that - don't you think it's quite a pain in the bum having to adjust tab size in every single editor and viewer just to make tabs semi-useable?[/QUOTE]
You're gonna have to adjust that for [I]editing[/I] anyway, or you're gonna end up mixing indentation styles.
(Unless your editor (correctly) autodetects the indentation style or the file has a modeline and your editor parses that.)
[QUOTE]I've yet to read what I'd actually gain from using tabs[/QUOTE]
Me neither, I'm not arguing for tabs here.
[QUOTE=DrTaxi;52374550]
You're gonna have to adjust that for [I]editing[/I] anyway, or you're gonna end up mixing indentation styles.
(Unless your editor (correctly) autodetects the indentation style or the file has a modeline and your editor parses that.)[/QUOTE]
I usually roll with EditorConfig for all my projects
I find that copy and paste for all my scripting needs works out great :hammered:
[QUOTE=NotMeh;52374519]I've yet to read what I'd actually gain from using tabs[/QUOTE]
You don't gain or lose anything. It's whitespace all the same.
It's almost like there's no point in unironically discussing tabs vs spaces.
Sorry, you need to Log In to post a reply to this thread.