21 ms·
Tabs, spaces and your salary – how is it really?
- matthewwarren 9y agoIf you're interested, here's some replies from the author or the original article, discussing this post https://twitter.com/drob/status/877181598420135936 https://twitter.com/drob/status/877181598420135936
- shmageggy 9y agoI had the same thought https://twitter.com/drob/status/877179616322084864 https://twitter.com/drob/status/877179616322084864 > I'm not sure I'd agree with the conclusion that version control breaks the indentation pattern found elsewhere The graph still looks like git-spaces is significantly higher
- spinlock 9y agobut, git-tabs is higher than foundation-spaces.
- pavement 9y agoWhat, no graph of journalists salaries, comparing those who cover the tabs/spaces debate, versus those who don't?
- kough 9y agoThis author must use spaces.
- passive 9y agoThis seems fairly straightforward to me. If you're collaborating, spaces are a much better default. If you're collaborating, your job is harder than coding solo, so you should get paid more.
- jimmaswell 9y agoI work on collaborative projects, some use spaces or tabs and it makes no difference to the ease of collaboration. It's just a setting in the .editorconfig.
- Peaker 9y agoIn all collaborative projects I've been that allowed tabs, all files that had been edited by tab users were a mishmash of spaces and tabs that made no single tab width configuration workable. If you chose tab width as 4, some parts of functions would look right, others would have messed up indentation. Ditto for any other tab size. The theory of tabs for indent and spaces for alignment works. But when collaborating, the practice requires too much support from tooling and too much education for humans -- so it's just not worth the tiny benefit.
- biggieshellz 9y agoSeems to work OK for the Linux kernel, and the tooling is not onerous -- just run checkpatch.pl on your commits before pushing them upstream.
- user5994461 9y agoThe kernel has an official & mandatory rule to enforce tabs, at a length of exactly 8 spaces per tab. Anything that doesn't respect that will be rejected without mercy.
- Veedrac 9y agoThat's not a fair comparison. You either disallow tabs, or you disallow spaces. A mismatch isn't either, so it doesn't evidence either being better than the other.
- dxhdr 9y agoDisallowing spaces isn't an option, you can't align code using tabs. You have to both disallow spaces and enforce a no-alignment (leading-indent-only) formatting style. Just use spaces! You can't mess it up. ;)
- lcnmrn 9y agoHow many spaces?
- AlexCoventry 9y agoMore importantly: vi, or emacs?
- marcgcombi 9y agoOMG Hilarious.... this is really funny.
- davedx 9y agoIn the Netherlands it is almost universal to discuss salaries in terms of monthly salary amount.
- gpvos 9y agoYes, using the yearly salary as the main reference seems to be either a US or an Anglophone-world thing. What is commonly done in the UK and Ireland?
- lmm 9y agoIn the UK we talk about annual salary.
- matthewwarren 9y agoIn the UK, almost no-one talks about their salary ;-)
- jonathanbull 9y agoSpot on! On the rare occasion we do, it's discussed in terms of an annual amount.
- ascorbic 9y agoQuoted annually, paid monthly, discussed never.
- freehunter 9y ago(In the US) I actually found it weird when I was talking to a loan officer and he asked how much I made. I told him, and he about jumped out of his seat. "PER MONTH?! WHAT DO YOU NEED A LOAN FOR?!" I was flabbergasted. I'd never had someone ask me how much I make an expect me to say per month. I don't know how much I make per month. I know per year or per paycheck. If you want per month you'll have to get out the calculator, buddy.
- gpvos 9y ago
- danjoc 9y agoManagers hate him. Learn how to get a raise, using this one simple trick!
- JoshMnem 9y agoThe original story reminded me of this site: http://www.tylervigen.com/spurious-correlations http://www.tylervigen.com/spurious-correlations
- intrasight 9y agoThanks. Now have new argument for my colleages to convince them to use spaces.
- simonh 9y agoWhen you have large amounts of data, even if it's for a large number of people eventually youre going to find odd 'correlations' between unconnected variables. People who play edition X of Dungeons and Dragons are 30% less likely to eat chicken sandwitches than people who play edition Y. If you know a thousand things about everybody, the data is going to be riddled with bogus 'connections' like this. In this case it's too small a sample for this finding to be significant, but increase the sample size and also increase the number of data points per person and you get similar problems. Determining significance is not straightforward.
- var_explained 9y agoThis is not the reason for the correlation. The p-value of the tabs/spaces connection is about 10^-13 (one in 10 trillion), and it can be found separately within each (large) country. This does not mean the effect isn't confounded with some other factor, but it does mean it's not a multiple hypothesis testing issue. You can explore the code and regression yourself! Take a look: https://github.com/dgrtwo/tabs-spaces-post https://github.com/dgrtwo/tabs-spaces-post
- sigstoat 9y agoyup, the multiple comparisons problem: https://en.wikipedia.org/wiki/Multiple_comparisons_problem https://en.wikipedia.org/wiki/Multiple_comparisons_problem a common reason for a study to be total junk.
- mrkgnao 9y agohttp://www.tylervigen.com/spurious-correlations http://www.tylervigen.com/spurious-correlations
- inanutshellus 9y ago= Why Grown-Ups Don't Use Tabs[1] = * 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: [tab]void someNiceMethod(int myParamA, [tab][tab][tab][tab][space][space]int myParamB...); (What you should do--if you're going to visually align at all--of course, is [tab]void someNiceMethod(int myParamA, [tab] int myParamB...); ... but humans are humans and IDEs aren't created equal, so this doesn't happen consistently.) * 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 AND IDEs that let you treat spaces like tabs. [1]: This came up last week (https://news.ycombinator.com/item?id=14560042 https://news.ycombinator.com/item?id=14560042) and this comment is shamelessly copied from that discussion (https://news.ycombinator.com/item?id=14561223 https://news.ycombinator.com/item?id=14561223).
- raverbashing 9y agoLinux uses with tabs and fixes the amount of spaces a tab is equivalent to is 8 spaces (for visual alignment) Problem solved and it works for them
- lucb1e 9y agoI was going to say you're obviously incorrect because in what editor can't you change your tab width? But I realized you are probably talking about the kernel.org project. Is that what you mean? There is an agreement within the Linux kernel project?
- quadrupleslap 9y agoYep, right at the start of the kernel style guide: https://www.kernel.org/doc/Documentation/process/coding-style.rst https://www.kernel.org/doc/Documentation/process/coding-styl...
- drostie 9y agoI think that the original article made it clear that it was a correlation, not a causation. There is probably some underlying cause to both trends, something like "there are people who tend to be really ticked off about 'this operates slightly different in two different environments', such people are more likely to (a) use spaces and (b) have an engineering-type job that pays a little more." Another possible correlation would be "people who are more worried that they will someday have to SSH into a machine where they have not yet configured an editor in order to insert debugging statements into the live production code, tend to come from DevOps backgrounds that earn slightly more, and also tend to favor spaces instead of tabs because that damn default tabstop is 8 and I can handle 2, 4, and maybe even 3, but 8 is too damn high..." or so. I personally really preferred tabs in my youth as a sort of nod to democracy and "everyone can set their tabstops however they like!" -- and it was Python that finally got me to use spaces instead, with the "hey when you want to do multi-line stuff" arguments[1] and PEP-8 and community agreement and such. But I do miss my little tab characters a lot. [1] You know, stuff like "If you want to do multi-line stuff, then you need to keep a conceptual split between using tabs for indentation but spaces for alignment; and if you're using spaces for everything then you don't: you can even use your tab key to insert many spaces at once. So it's tab-tab-tab-hit-space-twenty-one-times versus tab-8-times-then-space-once. Worse, if you screw up the mixed tabs-and-spaces format then you won't know about it unless tabs are clearly visible by default, which adds visual noise to your file..." etc. etc.
- cr0sh 9y agoEver since I started using spaces, my salary has increased dramatically! I mean, when I first started, I was only making minimum wage. I had to use tabs, my life was horrible! Then I switched to spaces. Instantly, my boss noticed my increased productivity, and my character count went up! I started getting free lunches! My dogs became straight-A students! I started winning in League of Legends! ...and my salary increased by $90k! It was amazing!
- jankotek 9y agoThere should be a third option "do not know". This was important maybe 10 years ago. Today IDE is handling formatting for me, and I no longer remember what the default settings are. The same about encoding or EOL chars.
- khedoros1 9y ago> This was important maybe 10 years ago. It's important today too, depending on details of the dev process. The IDE or editor handles formatting, sure. Different ones do it differently though, and keeping things consistent between environments often requires some reconfiguration of the software (or automated converters on checkin/checkout, if you want to go that far...)
- creepydata 9y agoEvery editor has different defaults and ever developer uses a different editor. You want consistency throughout the project.
- j_m_b 9y agoWhenever this old debate comes up, I am reminded of this quote “There's a good part of Computer Science that's like magic. Unfortunately there's a bad part of Computer Science that's like religion.” - Hal Abelson I don't worry about indentation because emacs does it for me. However, if this is your personal pet peeve then you should provide all of your developers / contributors with a plugin, script or other utility that formats their code to your standards. This issue has long been solved programmatically and it is a waste of mindspace to deal with it any other way.
- leggomylibro 9y agoThat quote reminds me of one of Joseph Campbell's - "computers are like Old Testament gods; lots of rules and no mercy." And to go along with that, some things like GNU Make still requires tabs, which is definitely annoying when you have your editor set to autoconvert. And some sects like Go or Python don't technically REQUIRE one or the other, but still try to aggressively purge the heretics.
- na85 9y agoIs that a limitation in GNU Make or is it an inherited limitation of m4? In my experience, m4 is an arcane bit of software that surprisingly few people know about and one that frankly should have been replaced years ago. Personally, I try to never use autoconf because of this.
- dasyatidprime 9y agoTab as the prefix for command lines is a property of all Makefile formats I'm aware of (though not of many other build script formats). Make itself (including GNU Make) does not generally use M4, though both Autoconf and Automake use it, often in conjunction with Make, as part of the Autotools suite which is also published by GNU. So, none of the above, in itself. It is a historical anomaly which has been preserved.
- khedoros1 9y agoI haven't dug into it, but Wikipedia claims that Make is actually about a year older than M4 (obviously not GNU Make).
- hellofunk 9y agoI've never understood the tabs versus spaces argument. It's not really a question of a coder's individual taste, is it? Arent these things usually decided by the choice of IDE? For example, I use Emacs, and when I press the tab key, it is actually inserting several spaces, not a tab character, at least in the language modes that I use.
- spinningarrow 9y agoBut does everyone you work with use the same editor/IDE? I think that's where problems begin (and are subsequently solved by the introduction of something like editorconfig).
- marcosdumay 9y agoExcept from some niche Windows only tools, I've never seen an editor that defaulted to tabs.
- creepydata 9y agoEclipse defaults to the tab character, at least for Java.
- marcosdumay 9y agoOh... That means I mix tabs and spaces on Java :( I did never notice it.
- pmoriarty 9y agoWhat emacs does when pressing the TAB key is fully configurable, and many people do indeed configure that behavior to their own tastes.
- khedoros1 9y agoI use vim (or vi on some antiquated machines). Others in the company use Emacs, Visual Studio, Qt Creator, Sublime, and so on. When the company was more startup-ish, it was a matter of individual taste, influenced by their IDE/editor. Giant checkins of mostly whitespace changes eventually became an issue, and were banned. Years later, and the code it mostly spaces, but I see places in the code with random tabs in between, every now and then. For my case, vim handles a bunch of auto-format and auto-indent options turned on, and replaces the tab key with 4 spaces, unless I'm editing a Makefile (where commands to execute are preceded by a tab character).
- gambiting 9y agoI'm from Poland and I can confirm - literally no one even thinks about their salary in terms of a what it is annually - I suspect the author is correct in thinking that a lot of Polish respondents wrote in their monthly, not annual salary.
- koblas 9y agoKudos to the author for doing a bunch of good data analysis and investigation. Pro or con against the result it gives a better context in which to read it rather than a simple headline that you can use in the next argument you have. IMHO while the author touches on Git/OpenSource contributions as part of higher salaries. What it also touches on is people who are working on improving their skills and contributing understanding which is a different individual than somebody who just takes surveys and works at a big company.
- KaoruAoiShiho 9y agoThere are some good reason for using spaces instead of tabs and good reasons but I'm sure it's mostly just a uniform. It's now a cultural meme that spaces is better, and people who are exposed to this meme tend to be more connected to the higher end of the community than people who aren't. It's like the correlation of people who curse making lower salary and people who wear suits making higher salary.
- zild3d 9y agoSilicon Valley on HBO actually made the opposite conclusion, that tabs are better (Richard did not hire someone because they used spaces). The main point being pressing space bar 4, 8, 12 times etc is a waste of time I think it also shows where a lot of people get confused, that being in the "spaces" camp doesn't necessarily mean you are pressing the space bar each time
- matmo 9y agoI think his argument was also that spaces would take up 4 characters, whereas a tab would take up 1. As a compression company, it "only made sense for him to choose the lower character count".
- khedoros1 9y agoFor the sake of argument: "As a compression company", isn't data redundancy exactly what they're supposed to handle?
- KaoruAoiShiho 9y agoYou still press tab on the keyboard and your IDE would render it as spaces. Whichever writer made such a strange statement is decidedly in the lower end of the community.
- raverbashing 9y agoGiven whitespace is immaterial to the end code (while it is used to indicate blocks in Python, you could theoretically use something else to indicate blocks) I have this idea of making each editor indent the code their preferred way and have the canonical source code in an specific fixed way with no alignments or needless spaces
- mmjaa 9y agoHonestly I've been avoiding this conversation for the last week, but it seems the right time to bring it up: tabs are content. Spaces are content. They are both part of the SET. Everybody, just give it up. They have their users. They have their uses. (:set shiftwidth=4;noexpandtab)
- justforFranz 9y agoWho gives a squat?
- cholantesh 9y agoI thought this was a joke, but then I see all this earnest, heated discussion over a non issue.
- pflats 9y agoI keep thinking that "employer" is the biggest confounding variable here. A quick survey of some of the big players, whom I would presume pay premium salaries, seem to favor spaces over tabs. e.g. https://google.github.io/styleguide/cppguide.html#Spaces_vs._Tabs https://google.github.io/styleguide/cppguide.html#Spaces_vs.... https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions#layout-conventions https://docs.microsoft.com/en-us/dotnet/csharp/programming-g... I can't find an Apple style guide, but the first file on the most recent commit to Swift uses spaces as well. https://github.com/apple/swift/blob/e0f75bf841631a50f9ab6502dc6c13b3abcaaf1c/stdlib/public/SDK/CoreGraphics/CoreGraphics.swift https://github.com/apple/swift/blob/e0f75bf841631a50f9ab6502...
- var_explained 9y agoThat was an early hypothesis I considered, but it doesn't fit the data. That would show up as a larger tabs/spaces salary gap for big companies, when in fact the gap is similar across all company sizes: https://twitter.com/drob/status/875493967865008129 https://twitter.com/drob/status/875493967865008129 Perhaps it could play a role as a more indirect effect: people leaving Google/Microsoft/Apple/etc, starting new companies or joining senior positions at others, and spreading this particular practice.
- jcranberry 9y agoOnly informative comment thread I've seen so far. I was wondering about this.
- sacht 9y agogofmt
- pklausler 9y agoI used columns 7-72 for code for Fortran IV and I liked it. I used 3 spaces for Pascal and PL/I and PLUS and I liked it. I used no indentation whatsoever for APL and I liked it. I used spaces for CDC and Cray-1 assembly, tabs for microprocessors, and had no productivity difference. I used tabs for C and I liked it. I aligned everything on the ':-' in Prolog and I liked it. I use 2 spaces for C++ and that's the only part of C++ that I like. I use no regular pattern for Haskell and it's perfect. It doesn't matter. Let your team's format zealot win this argument. Find another hill to die on, like naming conventions or "using namespace std;".
- thephyber 9y agoI expected to see "I used no spacing whatsoever for PERL and I liked it."
- pklausler 9y agoFor those who like things like Perl, Perl is exactly the sort of thing that they like.
- gbacon 9y agoUnfair [not to mentioned tired, boring, unimaginative, and overused] stereotypes are awesome! https://perldoc.perl.org/perlstyle.html https://perldoc.perl.org/perlstyle.html > Just because you CAN do something a particular way doesn’t mean that you SHOULD do it that way. Perl is designed to give you several ways to do anything, so consider picking the most readable one.
- pklausler 9y agoI would appreciate it if you would describe the stereotype that you think that the text of my comment somehow cast upon Perl programmers, other than the intended tautology.
- 9y ago
- thanatropism 9y agoHere's what she's still missing. Models about things like salaries and prices have to be careful to disentangle supply and demand. The insinuation when you hear that space-users earn more than tab-users is that space-users are somehow more productive, sexier or in with the times. When, as other commenters here have noted, large cool corporations tend to contribute to and use open source code, which is more often space-aligned. The money question here is -- can I improve my earnings potential by switching to spaces? And this isn't solved by just noting that spaces correlate to Git and open-source; what I need to know if switching to spaces (or using Git) changes my supply of productivity-adjusted labor; or if it's just what they use in higher-paying jobs. Here's how you disentangle this: you pick a variable that correlates to X (spaces vs tabs) but not to y (salaries). The textbook example is the demand for foodstuffs. Regressing quantity bought versus price tells you very little (supply and demand may be moving simultaneously); instead, you add something like crop productivities as an instrumental variable to filter out the supply effects and see the demand only. https://en.wikipedia.org/wiki/Instrumental_variable https://en.wikipedia.org/wiki/Instrumental_variable
- luhn 9y agoWait, did people take Stackoverflow's post serious enough to merit a response? I enjoyed the original article and I especially enjoyed the semi-facetious flamewar that broke out here on HN, but I thought it was pretty well understood that it was a meaningless, albeit interesting, correlation.
- marcosdumay 9y agoIt patently obvious that liking spaces or tabs better won't change your salary. But it's also an incredibly clear correlation. It must be caused by something (because it's too clear to appear by chance, and too stable on sub-populations). It may be very interesting to find that cause.
- Sean1708 9y ago> It must be caused by something You'd be surprised: http://www.tylervigen.com/spurious-correlations http://www.tylervigen.com/spurious-correlations
- marcosdumay 9y agoSpurious correlations normally aren't present on sub-populations (unless you try to segment your population on many different ways, what they did, but it was present on nearly all of the ways).
- lmilcin 9y agoTo make long story short, somebody discovered that developers who take care of their code -- how it looks and how it is being processed in a code repository -- get higher salaries. I earn my living from converting each company I work for to use a proper development process, and that more often than not includes migrating to Git. Why would anyone want to use Subversion in the presence of clearly superior tool, is beyond me. Why this matters is, contrary to popular belief, not because Git is distributed or is more sound technically. It is because it allows you to create better and more readable commits by not requiring you to immediately commit to a shared pool of code that you then aren't allowed to change. This means that you can commit locally to your repository as soon as you do any development. You can then work for however long you want to make your changes structured correctly in a readable way which is akin to refactoring code, only for changes. Only then you commit to the big ole repository maintained by your company. Good developers will recognize that the readability of your code and of your changes is of paramount importance. They will prefer tools that make it easier to create good and good looking code because they take pride in what they do.
- IshKebab 9y agoYes except that any code that looks good with spaces can look equally good with tabs (or tabs-for-indentation, spaces-for-alignment). I can't see any reason why git would work better with spaces than tabs so that seems like a weak argument too.
- lmilcin 9y agoCode with spaces looks always good. Code with tabs looks good if the other developer has the same tab length, but will not look correctly if it is wildly different, because of the right margin not lining up correctly.
- IshKebab 9y ago> Code with spaces looks always good. Only if you don't care about the indent size, which many people do (otherwise we wouldn't be having this discussion). I mean you may as well say everyone should use Times New Roman because then it always looks good.
- bigtunacan 9y agoThe article mentions in one sentence that PHP is also a factor, but then provides zero indication of how so.
- greaseball 9y agoBased on the survey results it looks like devs using PHP are paid significantly less on average. https://insights.stackoverflow.com/survey/2017#work-salary-and-experience-by-language https://insights.stackoverflow.com/survey/2017#work-salary-a...
- bigtunacan 9y agoThanks for the link.
- FrankyHollywood 9y agoNobody said anything about actual workweeks yet. I'm a developer working 4 days a week, earning a very decent 5 figure salary, no complains :) Now I can imagine if a company pays you >100k you have to work 40+ hours a week. So annual salary should be corrected for actual working hours
- misterbowfinger 9y agoThe point ------> . ----> everyone upset about this story
- slartibardfast0 9y agomixed
- nfriedly 9y agoI personally prefer tabs, but as suggested in this article, I do a lot of open source work, and use git for that and my job and spaces seem to win for both. So I use spaces. Also, amusingly, when IBM hired me (in the US), my contract listed my salary as $x per month. I'd seen it before from recruiters for jobs in London and such, but I don't think I'd ever seen it put that way in the states before.
- cja 9y agoNo sensible reader of the original SO article thought that correlation implied causation in this case. Using spaces for indentation is obviously a symptom of a better developer. That's all.
- deleted 9y ago[deleted]