14 ms·
Developers Who Use Spaces Make More Money Than Those Who Use Tabs (2017)
- cryptica 5y agoI use 2 spaces for indentation, but I agree that tabs are more logical. The reason why I switched to using spaces (years ago) is because tabs look terrible when copy-pasting code in a text area in the browser; they look way too big. If everyone chose tab spacing sensibly, then tabs would be ideal but there always seems to be some people somewhere who will exploit any flexibility provided by any technology to do something retarded. At least with 2 spaces, I have full control over how my code looks everywhere.
- pitched 5y agoI’ve noticed this before too! I think it’s because spaces are just lazier. Tabs might be more flexible but they do take a bit more effort. Someone who puts more effort than needed into one thing won’t stop at tabs.
- mosselman 5y agoIs 'lazy' the correct term then? Shouldn't it be 'more efficient'? By looking at the rest of your analysis anyway.
- pitched 5y agoYou’re right. I meant lazy in the Larry Wall sense (more efficient) but was also trying to pick a word that wouldn’t paint tabs in a bad light, because it’s more efficient in a different way.
- finalight 5y agoso in a way, the lesser i do, the more i get paid?
- nottorp 5y agoThis has been posted before. My theory is that people using spaces are more concerned about their code being readable outside one particular IDE on their machine and that could extend to them generally doing better quality work because they view the big picture better overall.
- deleted 5y ago[deleted]
- gjulianm 5y agoI don't know which editor you use but in my experience using tabs or spaces is just changing a single setting and then forgetting about it. The most likely explanation is that a lot of languages recommend spaces for indentation, so probably big companies just follow those guidelines and they also pay bigger salaries. Trying to find some causation of "people who use spaces are better" is not going to go anywhere.
- xdrosenheim 5y agoThis is clearly because people who use spaces, lie about their income.
- m463 5y agoMaybe they pad their paycheck and their files.
- FriedrichN 5y agoPerhaps they compare their productivity with their colleagues based on the size of their code in bytes. find -type f -name *.EXT -exec du -cb {} + | grep total
- postalrat 5y agoThey put what they think they are worth.
- bguebert 5y agomaybe they get paid per character typed
- tffgg 5y agoMy editor and IDEs convert tabs to spaces...
- orangepanda 5y agoNo one actually presses spacebar 4 or 8 times... Tabs, however, are superior - everyone can use the indentation they prefer without causing conflicts.
- mosselman 5y ago> everyone can use indentation they prefer without causing conflicts. To be honest, I never thought of this, I use spaces and my editor converts to 2-space indentation. But I can imagine that some people prefer 4 "space" indentation. With spaces this is impossible, whereas I now realise, an editor can render them any way it wants, so at 2 'spaces'. So I agree somewhat, that tabs sound good on paper. But then again, I don't want to start earning less all of a sudden...
- eloisius 5y agoIn theory I agree, but having recently worked in a code base that used tabs, it was painfully obviously that some devs displayed them as 4 spaces and some as 2 because they would visually align things for their editor’s configuration. It was very ugly.
- cjfd 5y agoThat is why one should use tabs for indentation and spaces for alignment. Then this problem does not occur.
- pjmlp 5y agoJust like with C and static analysers, there is the "one should" and what the large majority actually ends up doing, as usually no one enforces anything on large code bases in most development shops.
- benrbray 5y agoProbably needs a (2017). Past discussion [1,2]. [1] https://news.ycombinator.com/item?id=14560042 https://news.ycombinator.com/item?id=14560042 [2] https://news.ycombinator.com/item?id=20718031 https://news.ycombinator.com/item?id=20718031
- aminozuur 5y agoThanks, I've added (2017).
- tmccrary55 5y agoWhat about people who use tabs and spaces?
- orangepanda 5y agoYes! Tabs for indentation, and spaces for alignment. There is no other sane way
- mnd999 5y agoHopefully they code in Whitespace - https://en.m.wikipedia.org/wiki/Whitespace_(programming_language) https://en.m.wikipedia.org/wiki/Whitespace_(programming_lang...
- lioeters 5y agoThere's a special circle in hell for such people.
- totalZero 5y agoI'm surprised they didn't normalize for age, which is correlated with income up to a certain point and then drops off.
- argvargc 5y agoMost plausible explanation so far; a generation gap.
- raverbashing 5y agoThat's like saying people who use "import" clauses make more money than those who use "requires" clauses. I don't even know why this is a discussion, if ASCII has a character that represents an indent, we might as well use it (unless you prefer typing & as Et, < as LessThan, etc) That being said, yes, using spaces for arbitrary alignment is easier
- isitdopamine 5y agoSince some very popular languages (Python) actively discourage using tabs, this is most likely related to a difference in language choices, rather than in a genuine indentation preferences.
- mnd999 5y agoWhat about developers who follow the coding standards because they value consistency over personal preferences?
- zelphirkalt 5y agoBut how do they write makefiles? hard thinking face
- matbatt38 5y agoMaybe they don't and that's why they make more money
- King-Aaron 5y agoCorrelation and Causation something something
- maury91 5y agoJoke: Devs are paid by how many buttons they press, devs who use spaces press the spacebar a lot!
- thejosh 5y agodo you know any devs who use spaces who press space 2-4 times instead of their tab key that indents it 2-4 spaces?
- globular-toast 5y agoPeople use the tab key? Emacs automatically indents to the correct level and has done for decades I assume.
- gpderetta 5y agoright, and I would expect most editors to indent automatically these days. Do people really routinely indent code by hand?
- withinboredom 5y agoME. My editor is set for "tab chars" because that's what I work with (I did not choose this). When I use that editor to make a quick PR to a project using spaces, I have to press space a couple of times to indent. I'm not going to change my settings just to make a couple of line in a PR.
- fps_doug 5y agoI'm using vim with the detectindent script (with ugly hacks and enhancements)[1] for that, it gets this right most of the time if the source file isn't too short, including the number of spaces in case it's space-indented. [1] https://termbin.com/qzwzy https://termbin.com/qzwzy
- est31 5y agoPersonally, I'm a tab user in a language that does mostly spaces (Rust). My own projects use tabs but most projects I interact with use spaces. I had tabs in my editor for a long time and I would always either press the space button or change the editor's setting. Then I got sick of it and changed the editor's default. My own projects have an editorconfig file that my editor can read, setting it to tabs in the project's scope. The projects I contribute to usually don't have such a file, that's where the spaces-per-default setting comes in.
- traceroute66 5y agoSurely this nonsense is a textbook example of statistical overfitting ?
- blackbear_ 5y agoHard to overfit a median.
- thanatos519 5y agoTabs ... of acid? :-P
- elihu 5y agoI think there's a general trend where C programmers generally are near the bottom in terms of salary, and I think a disproportionate amount of C programmers probably use tabs (due to the popularity of the Linux kernel style). Or in other words: I know who's pulling down the average because it's me.
- d--b 5y agoWait, there are still people who use tabs?
- smallstepforman 5y agoYes, there are millions of us. When you need to backspace you immediately appretiate pressing the backspace key once instead of 4 times (or more).
- tokai 5y agoCtrl+Backspace deletes all the spaces in one go.
- turbinerneiter 5y agoThat's not how this works in any editor or IDE. I guess 99% of the arguments around tabs or spaces are wrong. I use spaces because that's common in Python, which is the first language I learned and because I saw some bad codebases that mixed tabs and spaces. But I don't think it matters. The only thing that matters is consistency.
- eMSF 5y agoWell, in some sense what happens with “smart“ indentation features in editors is anything but consistent (I know I'm not talking about the same consistency here), because they only ever make an exception for the backspace key to remove N spaces – in some cases. An arrow key only ever moves one space at a time and a delete doesn't ever remove N spaces and you can still land in the middle of an indentation level either with arrow keys or with your mouse cursor, etc.. And to make matters worse, the way the backspace key works isn't even always what you want; say you try to align something and happen to press space one time too many: in many editors pressing a backspace there doesn't fix your problem but only makes it worse...
- hknapp 5y ago> That's not how this works in any editor or IDE. i'm sitting behind visual studio, which requires backspacing through.
- FriedrichN 5y agoIt might have to do with the fact that people who use tabs have stronger principles (indentation should be one char!) and people with strong principles will generally have more conflicts with their colleagues and bosses. Usually conflict isn't good for salary negotiations or keeping a job. That's my 100% unscientific, non-evidence based guess.
- gjulianm 5y agoWhy couldn't it be that the people who use spaces are the ones with stronger principles?
- DocTomoe 5y agoPrinciples are founded in reason. There are good reasons for using tabs. I am still to find a good reason for using spaces.
- _old_dude_ 5y agoIt's easy to forget that programming is an art and being soul crushed by the business side of it. Space bar is our chisel, to craft beautiful codes and reassure our mammal brain that being in the zone make us closest to god
- mlang23 5y agoName a few please. I can only think of garbled alignment when reading a diff of a file which used tabs to indent. And that is not really speaking for tabs.
- DocTomoe 5y ago- semantic coherency: use only one character to signify an indentation level - user preference of UI representation of code: decide for yourself how far a tab indents a codeblock. - less reformatting necessary during refactoring and rewriting - separation of keyboard keys for different functionality Just the first few that come to mind.
- srl 5y agoThis is a huge effect. Implausibly huge? I'm reminded of Gelman et al's piranhas: http://www.stat.columbia.edu/~gelman/research/unpublished/piranhas.pdf http://www.stat.columbia.edu/~gelman/research/unpublished/pi.... The "folk theorem" version is that you can't have very many independent variables that all have large effects on salary. Saying that spaces vs tabs has a 10% effect is tantamount to saying that its one of the ten (or fewer) most important things about a developer. So there must be a confounder. What could it be? - Do the top schools all instruct students to always use spaces? This should have been partly taken care of when the author controlled for level of education though, right? - Choice of editor? This seems like a weird one, but editor defaults are definitely linked to tabs vs spaces, and the survey didn't even collect data on this. - Starting language? - Total number of languages used? Spaces are tolerable in more languages than tabs are. Of course, I'd expect "both" to beat "spaces" if this was the case. None of these strikes me as particularly plausible, except maybe the last one. This result is kind of bothersome, because it's big, obviously not a statistical fluke, and hard to understand. EDIT: a past thread (https://news.ycombinator.com/item?id=20719010 https://news.ycombinator.com/item?id=20719010) suggested that some higher paying companies mandate spaces. This also seems plausible.
- shinryuu 5y agoMy qualified guess is that PHP developers overall tend to use tabs more, and PHP developers are generally paid less on average.
- srl 5y agoIf you read the article closely, you'll see that they made some effort to control for programming language, and in particular they note that this effect occurs within each subpopulation. So, among PHP developers only, it's still the case that spacers make substantially more than tabbers.
- jcelerier 5y agoOnly thing I can say is that I started my career with tabs as it made more sense on the surface, but then over time migrated to spaces which did not have a lot of issues that I was encountering with tabs, while interoperating with other projects,etc. Spaces are much more frictionless than tabs, so maybe the attitude of trying to reduce friction would be such a variable ?
- mfbx9da4 5y agoCorrelation does not imply causation but very fun title!
- iamgopal 5y agoWhich should be the correct way ? Space or Tabs ?
- diegoperini 5y agoNeither. Consistency among team members is the correct way.
- throwawayffffas 5y agoIt doesn't matter just use the language convention, in python it's spaces in c it might be tabs. It really doesn't matter. My only pet peeve with spaces is people will occasionally use a number that is not a multiple of the indentation to align things with the text in the previous line. I find it unpleasant(harder) to read such code.
- avipars 5y agoWhat about IQ
- iovrthoughtthis 5y agowhere do all the people who use spaces work? is one (or some) high paying companies coding practices skewing the results?
- wavegeek 5y agoThis is because they are a) More smart b) More correct. It is not that complex. Also they are more likely to be using emacs, another big win.
- uniqueid 5y agoI dunno. When I automatically convert code from tabs to spaces, the end result seldom needs any revision. Going the other way almost always reveals a couple lines where the coder used an inconsistent number of spaces for no discernible reason.
- yummybear 5y agoAre there languages that lend themselves more to space-indentation? That could explain the wage gap.
- boffinism 5y agoYes. Ruby, for example, is entirely space-based, because it encourages line breaks after the first of a list of arguments, where the second needs to be aligned with the first, but depending on the number of characters in the method being called, the first argument could be anywhere in the line.
- brigandish 5y agoDo you have an example? I write Ruby and switched to tabs a while ago, haven’t noticed any problems.
- boffinism 5y agoOk, so first of all, I'd strongly advise you not to use tabs for Ruby, just because it's a community very heavily based on stylistic consistency, and the community is very much on the side of spaces (see https://ukupat.github.io/tabs-or-spaces/ https://ukupat.github.io/tabs-or-spaces/). For one example of something that wouldn't work with tabs (although not my original point, see the whitespace between `key:` and `key,` on line 66 here: https://github.com/rails/rails/blob/main/actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb#L66 https://github.com/rails/rails/blob/main/actionmailbox/app/c... For an example closer to my original point, see line 13 here: https://github.com/heartcombo/devise/blob/master/app/controllers/devise_controller.rb#L13 https://github.com/heartcombo/devise/blob/master/app/control...
- boffinism 5y agoSee also the first "good" example at https://github.com/rubocop/ruby-style-guide#no-double-indent https://github.com/rubocop/ruby-style-guide#no-double-indent, and the placement of 'from' in it
- vishnugupta 5y agoMaybe the causality is inverted? Instead of saying international athletes are more likely to use Nike shoes you end up saying Nike wearers are more likely to be international athletes.
- eckesicle 5y agoI suspect that this is partially caused by the fact that 'spaces' is the non-default choice in many standard IDEs such as Eclipse and the rest of its enterprise friends. Software engineers who make active choices in their setup rather than just accept default configurations and tools tend to be better at other aspects of their job too?
- mg 5y agoIn theory, tabs for indention and spaces for alignment would be the best way to handle whitespace. Unfortunately in practice, two factors are in the way: 1) Most developers are confused by this type of whitespace usage. Simply because it is the less popular practice. So when you have a codebase that uses tabs for indention, you get more broken commits from developers who stumble in keeping the system intact. 2) Out of the box, VIM has no easy way to colorize tabs. So when you look at your code, tabs and spaces look the same. You cannot say from just if the whitespace is ok or messed up. You can show all non printing chars with "show list" but that is not very nice on the eyes. Or you can configure "show list" to only highlight tabs but then you lose the ability to show all non printing chars.
- cryptica 5y agoMixed is the worst. It doesn't make sense logically. Isn't indentation just another kind of 'alignment'? After all, we use indentation to align text on the page... The differences between between all the supposedly distinct kinds of alignment are too subtle and difficult to describe in words to be used as a rule. It's better to stick to simple rules that are easy to follow and enforce - Leave no room for ambiguous interpretations. Also, I hate it when developers try to break up code in weird ways to align all the equal signs together for example. I would prefer that they never do this. Maybe if our eyeballs were stuck inside our heads in such a way we had to move our necks to read each letter, then it would be a good idea... Then it would be worth the complexity it adds. In the real world, however, moving one's eyeballs a few millimetres sideways isn't very difficult. There is no need to litter your pristine code with extra spaces just to save people from having to shift their eyeballs a bit when reading your code. You save the reader like 10 eyeball shifts out of 1000...
- benrbray 5y ago> I hate it when developers try to break up code in weird ways to align all the equal signs together for example. I do this in cases where I have many similar lines, for instance calling the same function many times with different arguments, and I want to make the differences between them more obvious. I find it to be much more maintainable and easier to read / identify bugs.
- globular-toast 5y agoI'm someone who uses spaces, but knows I should be using tabs. In other sad missed opportunities, see the ASCII delimiters: https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text That's right, four levels of delimiters, built in to ASCII! No unicode required. Instead of that we get CSV, with in-band delimiters and the resulting god awful quoting rules that go with that.
- kstenerud 5y agoI settled on spaces long ago for the following reasons: - Tabs move the cursor to the next "tab position" but are invisible, which means that whenever someone hits tab in the middle of something (accidentally or otherwise for alignment), you end up with messed up looking text and alignment as soon as you view it with a different tab size. - Trying to enforce "tabs only for indentation" rarely works without headaches because humans. - Using monospaced characters everywhere means that you'll never encounter positional issues ever. I've worked in 2-space, 3-space, 4-space, and 8-space indentation houses and honestly, I don't see the point of viewing indentation in your preferred size. It's easy to adapt to the house rules, and the benefits outweigh the headaches.
- cryptica 5y agoI'm a space person, but I disagree with the premise of the first two points. Exotic alignment such as trying to align equal signs on different lines together doesn't make sense... All the different cases are too difficult to describe in simple words. So it's better to simply not do it. IMO, the only whitespace in code should be to separate different tokens/words and for indentation. Adding whitespace to create any other kinds of visual effects should be discouraged. I ended up using spaces, entirely because of the last point and because there are many products out there which render tabs really poorly. I literally can't trust people to be sensible about how wide an indent should look.
- strogonoff 5y agoMy pet theory is that the preference for spaces comes from people who want their codebase to be equivalently readable in any editor right off the bat. With tabs, depending on editor configuration, the same codebase could look fine on one machine and be a mess on another. Furthermore, I believe that with certain indentation styles (e.g., when arguments in a function call align with the opening paren) tabs require that one extra preliminary step of configuring one’s editor in order to view the code properly, while with spaces that extra step has more optionality and is only needed in order to edit the code with auto-indent. IMO since one has to adapt their coding style to the dominant style of the codebase (single/double quotes, etc.) either way, one might as well adapt to the indentation as well, so I’m not against spaces. And of course, due to people who don’t take care to set up their tooling and end up mixing tabs and spaces for indentation, a particularly hot mess can arise—and what’s worse, that mess can accidentally look fine in editors that happen to be configured in a particular way. Because of that, I keep whitespace visibility turned on across my editors.
- srl 5y agoYour first point is closely linked to a theory raised in a past thread (https://news.ycombinator.com/item?id=20719010 https://news.ycombinator.com/item?id=20719010). Large, well paying companies tend to require everyone to use spaces, for pretty much exactly the reason you mentioned.
- trog 5y agoIs there a group of developers somewhere that charge per byte of code they write?
- abcdasfwe 5y agoi'm a python dev, and i don't agree with this
- Cerebrum1234 5y agoProgrammers who use spaces 'paid more'· Computer programmers who use spaces as part of their coding earn.
- Yizahi 5y agoDid anyone seen actual "broken" indentation on any system in the last 10 years? (specifically indentation, not mid line breaks filled with tabs) Because that is the only argument for spaces. Personally, I sometimes log onto very old boxes running some old OS and s/w, and I've never seen broken indentation display for tabs. I think replacing tabs with multiple spaces was a valid solution in 20th century, but not anymore for last decade at least. Instead it transformed into a cargo cult like obsession, with zero valid reasons today.
- jakub_g 5y agoIf you use tabs, GitHub renders it as 8 spaces, which is... a bit excessive and legacy IMO. I think until this is changed, using tabs for content that you want to be viewable in GitHub UI and has multiple levels of indentation just does not make sense.
- tapland 5y agoOh yes. The code wasn't written inte last ten years, but oh yes. I've also seen code from a senior dev which consistently used two tabs, eight spaces, tab for some reason. I replaced it with spaces to fit the rest of the 50k lines (COBOL) when I was in the area making a change. We are also saving 5-10% storage by removing whitespace at end of line, so.
- Yizahi 5y agoI was asking not about the badly written code. I was asking about when you have lets say "good" code with tabs, when they are used for indentations and there is a single tab per line start, but that file is for some reason displayed garbled because text viewer/editor on the host can't work with tabs properly. Because that was the reason always given for spaces usage - "what if I want to open code with tabs on some super duper legacy system from decades back, and some weird editor will mess up my indents. Spaces are safe everywhere." And my point was that I haven't seen a system which can't handle displaying tabs in very long time (or ever).
- tapland 5y ago
- hankchinaski 5y agoChocolate consumption per capita is positively correlated with the stock of Nobel prizes per capita [0] [0] https://www.sciencedirect.com/science/article/pii/S2590291120300711 https://www.sciencedirect.com/science/article/pii/S259029112...
- jcelerier 5y agoIs it that surprising that researchers coming from more developed countries consuming a most common sweet in europe (thus, likely of mainly western culture) would fare better on an evaluation by a Swedish committee ?
- Ballas 5y agoMight be unfounded, but my personal theory is that the correlation might be something as simple as companies that adopt (for instance) the Google C++ coding style guide pay more.
- nyuszika7h 5y agoThere are plenty of reasons for preferring spaces: * There will always be that one diff tool/website which doesn't support configuring the tab width and renders your code with 8-space tabs. Even if every tool you use supports configuring this, it's going to be a nightmare to configure every single tool when the default of 8 is not sane for the majority of people. * If you enforce a maximum line length for your code, people who use a different tab width than you are bound to mess this up. I mean, you can somewhat avoid it with an automated linters, but then again, which tab width do you set it for? If you set it too low, it will look bad people with bigger tab widths working on a split screen. If you set it too high, code will be unnecessarily wrapped everywhere and it will look bad. * Mixing tabs and spaces to ensure proper alignment of function arguments with any tab width can be a nightmare. Someone on your team is definitely going to mess it up eventually, and you'll have to clean up after them. With spaces enforced, indentation and alignment will look the same everywhere and mistakes will be immediately obvious regardless of the tool used for code review. (Editors may support differentiating tabs visually, but I don't think GitHub or GitLab does.) On a team project, you don't get to choose other things like brace style either. You just have to learn to deal with it. There are too many variables to account for, such as the ones I mentioned above. Using spaces ensures consistency everywhere. In an ideal world, you wouldn't have to worry about all this, you would just store a minified version of the code and your editor could format it with your preferred tab width, line length, brace style, etc. But in reality, it's not that simple. Auto-formatters are far from perfect.
- mclightning 5y agoDevelopers who are not stuck on the argument of this duality are making even more.
- jl2718 5y agoNot true. The article points out that they are paid the same as the tabbers.
- thenoblesunfish 5y agoDo employers who tend to pay more (e.g. Google) tend to have style guides which encourage spaces over tabs?
- jl2718 5y agoIn the beginning, there was only tabs, and all indentation was exactly one tab greater than the prior context. Then, a few people started doing tabs and then spaces to indent their function arguments to align with the opening parenthesis of function arguments. Why? Because it looks like a windows drop-down menu hierarchy, opening the sub-menu to the right of the selection. These people tend to be UI-focused, heavy PowerPoint users, CS 101 teachers, and management types. This was okay when everybody was using MSVC or Visual Basic (no Unix person would do this), and so tabs-then-spaces code crept into everything. Tab purists were at worst mildly annoyed. There was no such thing as a space purist. They would have been physically assaulted for banging on a mechanical space bar that many times in a cubicle office. But if you opened up that file in notepad.exe, or wordpad.exe, or TextEdit, or Borland or vi or emacs or any other text editor, you would get a preview of the chaos that was about to be unleashed. When the web became popular, the standard programming environment for a lot of people became “right click -> view source”. Space width was all over the place. Tab width was blowing text off the page. Word wrap was horror, and saving a file in word wrap mode saved the imputed carriage returns. But that was still just aesthetics. When python became popular, it changed behavior. Python tried to adapt by allowing many different styles of indentation. It worked most of the time, but not all the time. This is how it turned into a full-on war. It is easy to convert tabs to spaces, and hard to go the other way. So naturally, people wrote a simple script to convert tabs to the right number of spaces. Then immediately the number of key bangs rose to a deafening roar. Nerf sales went through the roof as the office became a war zone. The accountants were still using pencil and notebook. So people tried to write scripts to convert back to tabs. Hahahaha mortal. You can never go back. Your attempts are futile and the one bug you introduce will be your undoing. Foolish tab purist! Come to the dark side and embrace the space. Yesssss... see that giant bar at the bottom of your keyboard? Hit it! Again! Louder! What’s that? You made a mistake? Lost count? Start over! Hahahahahaha! Then editors changed to no longer record your keystrokes, but instead try to guess at what you mean and show you what it wants you to have meant. These editors have other great features to churn out reams of code that nobody will ever be able to review or keep up with, which is the key to leading a project and getting that promotion. The worse the code, the more people you’ll have to manage to get it working. Meanwhile, tab purists are an exiled minority, unable to find anybody to work with, begrudgingly accepting their orders from some young superstar coder that blew out the git log in their first 30 days on the job. Oh the lowly tab purist. Go home and seethe; you are defeated. Watch again one of the five movies you own on your Betamax or HD-DVD. Better standards? Hahahaha!
- paulolc 5y agoDon't get lured by the Dark Side! Accessibility is the real reason you must use tabs instead of spaces for indentation [1]. Yes, it's evident that Accessibility is not valued and that it's easier/cheaper to not care. We should start to care. Maybe it doesn't even cost that much. Just by flagging it on formatting commit hooks or in some plugin in static analysis tools like Sonar, would go a long way in raising awareness and improving this. Developers with visual impairment have different needs regarding indentation. One could need a tab-width of 1 due to the use of gigantic font size and the other a tab-with of 8 because of a wide monitor. [1] Nobody talks about the real reason to use Tabs over Spaces https://news.ycombinator.com/item?id=20381027 https://news.ycombinator.com/item?id=20381027 https://news.ycombinator.com/item?id=20341354 https://news.ycombinator.com/item?id=20341354) Previous threads https://news.ycombinator.com/item?id=20381027 https://news.ycombinator.com/item?id=20381027 https://news.ycombinator.com/item?id=20341354 https://news.ycombinator.com/item?id=20341354
- will4274 5y agoMeh. I find "accessibility is the trump card" arguments as blase as "security is the trump card" arguments - such arguments reflect badly on their speakers - all is tradeoffs. In the linked case, I'd argue that specialized fonts or editors are a better choice. After all, even if you make all the code in your repository "accessible" by using tabs, your accessibility-limited colleagues might have to interact with code outside your repository (e.g. Stack overflow, or dependencies) that uses spaces. Something in the presentation layer (e.g. fonts or a screen reader) is far more likely to work consistently and correctly. Solve problems at the right layer. That stated, I can see why such an objection might win the day. Nobody wants to take on the accessibi problem when solving a small problem like spacing consistency.
- Stranger43 5y agoThe question here is what space vs tab use is actually an proxy, which is a question you generally need to ask when you get weird but valid statistical results. If there for instance was an correlation between having lived though the bad old days with primitive build/formatting tool chains and a preference for spaces that would easily explain a difference in salary that have nothing to do with the argument for/against tabs/spaces as it relates to modern tooling.
- dang 5y agoSome past threads: Developers Who Use Spaces Make More Money Than Those Who Use Tabs (2017) - https://news.ycombinator.com/item?id=20718031 https://news.ycombinator.com/item?id=20718031 - Aug 2019 (148 comments) Developers who use spaces make more money than those who use tabs - https://news.ycombinator.com/item?id=14560042 https://news.ycombinator.com/item?id=14560042 - June 2017 (663 comments)
- mikewarot 5y ago[Edit: Personal Usage] I use space within text, and TAB/Shift-TAB to move between data entry fields. You never know when a TAB key is going to do something weird outside of your home IDE. [/EDIT] They missed an axis.... sure you can compare Space vs Horizontal Tabs, but what about Line feed vs Vertical tabs? Form feeds are similarly overlooked. Also missing is the lf / cr-lf debate 8) PS: Does anyone use Group, Record, or Unit Separators? Reference: https://theasciicode.com.ar/ascii-control-characters/vertical-tab-male-symbol-mars-ascii-code-11.html https://theasciicode.com.ar/ascii-control-characters/vertica...
- mvolfik 5y agoMy guess is that lf/crlf is just a proxy for windows/linux comparison
- renewiltord 5y agoMaybe it’s “Developers who care about tabs v spaces spend more time on that discussion and therefore make less money than those who go with the defaults (all spaces)” A.k.a The Market Hates Bikesheds
- ybbond 5y agoActually, I like tab. It gives people more choice on how their code looks like based on their editor's preference. But no, I cannot —even sneakily, manually— enforce tab in my company(es) code bases. Reasonable person uses formatter which opinionated config set from the first commit. And I like the formatter decision better. If it is automated and reduce unnecessary debate between devs, why not?
- alephnan 5y agoBecause Google engineers use spaces, even after they leave Google
- Threeve303 5y agoThis is why early languages had no white space at all. /s
- blarg1 5y agoWhat if I use both?
- u801e 5y agoUsing hanging indents works regardless of whether one uses spaces or tabs. But trying to align text based on the indentation of the opening parenthesis (of it's on the same line as the method name) pretty much only works well with just spaces.
- junon 5y agoIf I recall, someone mentioned this was probably because the majority of IDEs come pre-configured to use spaces for indentation over tabs. Therefore, the study is skewed as most people don't update their IDE settings unless they're particular about them (IME this sounds like it's true).
- kodah 5y agoWhy do people try to put accessibility arguments on people rather than doing this intelligently per language in the IDE? The functions to convert tabs and spaces (not mention how to represent them) is entirely configurable already. Is there something I'm missing?
- hpen 5y agoJust use a code formatter and half the issue highlighted in these comments disappear
- alanchen 5y agoCorrelation != Causality
- hackerbabz 5y agoI don't even know what I use. It probably changes in different repositories. I've never cared enough to check or set it one way or the other, and definitely don't care enough to have a 20 minute meeting with my team to decide.
- EVa5I7bHFq9mnYK 5y agoI use spaces because long ago I had two editors, one of which showed a tab as 4 spaces, and the other - as 8. So spaces provided consistency, that's all. Maybe older developers prefer spaces for that reason, hence the salary gap?