Slashdot Mirror


Developers Who Use Spaces Make More Money Than Those Who Use Tabs (stackoverflow.blog)

An anonymous reader writes: 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. Coders who use spaces for indentation make more money than ones who use tabs, even if they have the same amount of experience. Indeed, the median developer who uses spaces had a salary of $59,140, while the median tabs developer had a salary of $43,750.

343 of 515 comments (clear)

  1. Pied Piper proves it too ... by drnb · · Score: 4, Funny

    Pied Piper proves it too, that tab loving company is one money losing screwup after another.

    1. Re:Pied Piper proves it too ... by siriuskase · · Score: 1

      It makes perfect sense that coders are paid by the character. A tab is only one character, not as much work.

      --
      If you must moderate, please moderate as irrelevent, not something bad, because I'm sure someone will find this interest
  2. Both? by TFlan91 · · Score: 2

    "considered themselves a professional developer" ... "with 17.5% using both"

    wtf? a professional developer uses both? really?

    if and when i find a file that has mixed spaces / tabs, not only that, but 3 spaces instead of 4 then a tab for the fourth character. I slap that dev so fast the dev will try to rewrite git history.

    1. Re:Both? by beelsebob · · Score: 1

      Probably means tabs for indentation, spaces for alignment. They're still morons though.

    2. Re:Both? by glenebob · · Score: 1

      Ever work with code that uses 4 spaces for column one, 1 tab for column two, 1 tab and 4 spaces for column three, etc.?

      *shudder*

    3. Re:Both? by pkuyken · · Score: 1

      Unfortunately I am one of the types that uses both (but only out of consistency). Some projects (typically older ones) use tabs, while our newer projects correctly use spaces.

    4. Re:Both? by BronsCon · · Score: 5, Insightful

      I can actually see the argument for a 4-space indent consisting of 3 spaces and a tab. The developer thinks they're throwing a bone to people who use tabs by allowing them to set their own indent width. But they're wrong to use spaces at all in that case; what about people who prefer 2- or 3-char indents?

      And that's why tabs should be the standard: people prefer different indents. Using tabs, everyone can have their way; set your tab width and all tabbed indents are automatically the width you want.

      Now, for those who insist on tabs, let me explain why spaces are better: they allow you to align parameters and operators after the indent.

      That's why my preference is to use tabs to indent, then spaces to align after the indent; best of both worlds. You're already using the tab key to indent and the spacebar to align, so there's no mental or physical overhead involved, the layout of your code is preserved and, if someone else prefers a different tab width, they can have it without breaking the alignment of arguments or operators (if you bother to make them look pretty) or altering how the code displays for you, or anyone else.

      But, that's just a preference. When I'm working on someone else's code, I follow their conventions, because it really doesn't take any time at all to change an IDE setting (especially when my IDE can store per-project settings for things like tab width) and I'm not a dick.

      Beyond that, if someone uses tabs on some lines and spaces on others within the same file... yes, slap them silly.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    5. Re:Both? by kristianbrigman · · Score: 1

      I use both(*), because not all indenting is for blocks - sometimes it's for a multiline list/string/dictionary, and for those I usually try to line up the second lines to
      match where it started in the previous line to look better, and that depends on the length of the function name so isn't always an exact multiple of the tab width.

      But I think you can also read from this that people who use spaces may care more about what their code looks like, which usually means they might care a bit more about what their code does as well.

      (*), because my IDE converts all the tabs to spaces anyways - yes, I mostly am working in Python.

    6. Re:Both? by Wraithlyn · · Score: 1

      Who said it was within the same file?

      For instance YML files specify that spaces must be used. But maybe tabs are standard on the project for other files.

      But all of this is moot. In 2017, the correct answer to "tabs or spaces?" is "use fucking editorconfig and stop worrying about it".

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    7. Re:Both? by beelsebob · · Score: 1

      What's wrong is that errors are not transparent.

      If someone fucks up and puts a tab in the wrong place, or a space in the wrong place it's completely non-obvious to anyone until it's already in the repository.

      In practice, it ends up with a code base that's got all kinds of weird indentation issues because people fuck up this way with great regularity.

    8. Re:Both? by Misagon · · Score: 1

      People who use both might be using GNU indenting style
      where braces are indented half-way between the indenting outer and inner blocks.

      Myself, I indent labels and preprocessor directives in C (and like languages) with two spaces less and the rest with four-space tabs.
      That way, #ifdef's for disabling code does not affect the indentation of the code they disable and e.g. switch-case statements don't get indented so deeply.

      --
      "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
    9. Re:Both? by mpercy · · Score: 1

      But not both in the same file, surely.

    10. Re:Both? by edtice1559 · · Score: 2

      What is shocking to me is that we even have this discussion. There ought to be a check-in hook that properly formats the code. Would also reduce defects where a brace/bracket is missing.

    11. Re:Both? by edtice1559 · · Score: 1

      The answer is that the IDE should allow you to view the code with your own preferences, but what goes into revision control should get automatically formatted with whatever standard is set for a project.

    12. Re:Both? by beelsebob · · Score: 3, Interesting

      The reason that most places don't have these check in hooks is simple - rule 1 in all good style guides is "if breaking the style guide in one off cases makes code substantially clearer, break the style guide."

      Humans need to have the ability to say "no, in this one case it makes sense to do something odd to make this code readable".

    13. Re:Both? by computational+super · · Score: 1

      a professional developer uses both? really?

      Job security.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    14. Re:Both? by phantomfive · · Score: 1

      That's why my preference is to use tabs to indent, then spaces to align after the indent; best of both worlds.

      Yes. It's a pain to get editors to do this, though.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:Both? by BronsCon · · Score: 1

      That would be the ideal. Which IDE(s) will happily take a file indented with 4 spaces and display it with, for example, a 2 character indent? That's an honest question and I recognize that it's entirely possible that my IDE of choice does this and I simply don't know of the feature.

      That's why I believe tabs should be used for indentation; you don't have to rely on software guessing the correct tab depth when converting from spaces, then converting to tabs without fucking it up, then displaying those tabs at your desired width (which is the easy part, which we already have in basically every editor), then converting back to the correct number of spaces when you save. With tabs, you just specify how wide you want the tabs to be and bam that's how far your code indents. If you need to align things beyond the indent, that's what spaces are for.

      In my view, indenting with spaces is an egotistical power trip, an attempt to force your indentation depth preference on everyone who touches your code. Tabs are much more friendly to those whose layout preferences may differ from your own.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    16. Re:Both? by BronsCon · · Score: 1

      Howso? Configure it to use tabs to indent, then press TAB when you want to indent and SPACE when you want to align.

      Fucking Notepad can do it.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    17. Re:Both? by Darinbob · · Score: 1

      Experience is key here. If you've dealt with code for 30 to 40 years, you learn what works best, you know what is frustrating and try to avoid it yourself so as to not frustrate others. Code is viewed using more than just your own editor. It'll be seen on multiple editors and IDEs by multiple people who won't know what the preferred setting is. The code will be printed and that adds its own problems as the printer isn't smart enough and you don't always want to have to change settings on each file before printing (and believe me, each file will assume a different tab settings). Very often I view files using a terminal window; 'more', 'grep', 'tail'. The files will be displayed by static analysis tools using a browser, and online repository browser won't know what the preferred settings should be.

      Using a character in a file that means "1 to 8 characters" should go against the very grain of any self respecting programmer or engineer that values precision.

      I have found it amazingly rare for anyone to defend tabs as a superior choice, instead almost everyone I encounter using it has either not heard of the issue, didn't realize the editor was inserting them, or had trouble changing the tool. And I believe this, I've had people ask me to help set up their editor or IDE to avoid tabs and it can be difficult to find the settings. Sometimes you have to change the settings for each language individually! When I ask someone why tabs were used in a file I will inevitably hear an apology that they didn't realize it was happening.

      Now sometimes there's just something wrong or lazy with developers. I have worked on one file that used FOUR different tab indentation levels, with three levels within one function. That is, it was impossible to set a single tab level so that the function showed a consistent indentation level. This means people went and modified the file but refused to conform to the existing indentation levels, even going to far as to ignore that the lines directly above and below did not match. Laziness, orneriness, apathy, or? Either way, I would not have expected those developers to be amongst the higher paid ones.

    18. Re:Both? by Darinbob · · Score: 1

      This is not easy to do in some tools. I've seen some where you have to change tabs vs spaces settings separately for each programming language it supports. If someone keeps using tabs then you will keep having this problem and it is no longer moot. As soon as a file with tabs in it gets shared between different people and different tools the problem comes back. And with new developers showing up all the time ignorant about the issue or arrogant enough to insist on their own personal style, the problem will not go away.

    19. Re:Both? by lgw · · Score: 1

      Never auto-format - auto-formatting is the worst menace ever to readable code. It's OCD over functionality.

      Autoformating can get stuff right 95% of the time, but that other 5% matters a lot. Sometimes it's important to show the structure of data clearly through aligning columns in some clever way. Sometimes code needs to be formatted as a 2-D array (large switch statements). There's doesn't seem to be a good set of rules yet for the corner cases using in-line lambdas and stream/list comprehension stuff.

      I've rejected many a code review where someone carelessly auto-formatted something important.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    20. Re:Both? by BronsCon · · Score: 1

      Very often I view files using a terminal window; 'more', 'grep', 'tail'. The files will be displayed by static analysis tools using a browser, and online repository browser won't know what the preferred settings should be.

      If your tools of choice don't allow you to set a tab width, perhaps that is a problem with the tools. For example, if your more doesn't allow you to set tab width (mine does), try less; you'll find that it brings many other useful features with it, as well. Less manages this by replacing tabs on the fly with the desired number of spaces; beyond that, the rendering of the TAB character itself is a function of your terminal; if you want 4 character tabs in your terminal, configure it as such using the tabs command. If your terminal is not POSIX compliant and does not honor the tabs command, you need better tools.

      Likewise for your static analysis tools and repo browser.

      You're right, experience is key, and that includes being experienced enough to know how to properly use your tools to achieve the desired results. I find it hard to believe anyone with 30 or 40 years of experience doesn't know that; I know it didn't take me a full 30 years to figure it out.

      Using a character in a file that means "1 to 8 characters" should go against the very grain of any self respecting programmer or engineer that values precision.

      We don't write it to look pretty or display identically on every medium it might be displayed on. We right it to function properly.

      We also shouldn't be imposing our own indentation preferences on others. Someone working on a 22:9 display might prefer 8 character tabs because, hell, they've got plenty of horizontal space so why the hell not? Someone working on a 16:9 display might prefer 4 characters, and someone working a a 4:3 or 6:4 display might prefer 2 because they don't have as much horizontal space. I fit into all 3 categories depending on where I happen to be working; I have a workstation with a pair of 16:9 4k displays (well, one is portrait, so 9:16), a desk at a remote office with a 22:9 display, and occasionally use a Chromebook with a 6:4 display.

      I'll tell ya, while I never prefer an indent of more than 4 spaces, when I'm working on that Chromebook or happen to be viewing code on the portrait display at my workstation, I do prefer 2 spaces so heavily nested code still fits on screen without wrapping or scrolling. In general, though, I prefer 4 spaces on the 22:9 and 16:9 displays. I could see 2 spaces being preferable when printing 8.5x11, while 4 or 8 would look better when printing 11x8.5.

      How does one manage that when using spaces to indent?

      Now sometimes there's just something wrong or lazy with developers. I have worked on one file that used FOUR different tab indentation levels, with three levels within one function.

      That's not an issue with TABs. That might be why people who don't desire to enter pissing matches over how far a line should be indented prefer them.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    21. Re:Both? by BronsCon · · Score: 1

      ... "We write it", we don't... right... it... FML...

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    22. Re:Both? by Darinbob · · Score: 1

      Just an addendum. After writring that I went off to a code review, using a web browser based code review tool. The "diffs" window clearly had problems because tabs were used for indentation and things were lining up badly. Meaning, you can change your editor to match your own style with tabs, but you can't go out and change every tool in the world. Thus, spaces are safer and always consistent.

    23. Re:Both? by BronsCon · · Score: 1

      How, exactly, do tabs mess up alignment? You shouldn't be aligning things at different indentation levels in the first place... If, for some reason, you find yourself needing to do that, then yes, I suppose you should just use spaces.

      When I say "alignment" I mean aligning arguments in a function call that has been split to multiple lines (and thus will be at the same indentation level), aligning operators in an IF statement that has been split onto multiple lines (and thus will be at the same indentation level), and things like that. If tabs are messing with that, you're using them way wrong.

      When two lines of code are indented to the same depth, how (or how far) they're indented becomes irrelevant; you could pull them out of their current context, remove any indentation, and alignment wouldn't be affected. You could indent them by 1 space, or by 100, and alignment would not be affected.

      Can you please show me an example of what you're talking about, as I'm now thoroughly intrigued.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    24. Re:Both? by Wraithlyn · · Score: 1

      The solution to this is switching to a tool that supports .editorconfig

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    25. Re:Both? by Darinbob · · Score: 1

      Some lines indented with spaces, some lines indented with tabs. Some lines assume tabs are 4 spaces, some lines assume tabs are 3 spaces, some lines assume tabs are 8 spaces, etc. Yes, I have seen lots of files that do this, multiple types of indentation assumptions in the same file. Most typically is that the file has no tabs at all, then later a developer comes along with a different tool that uses tabs and makes some changes, now you've got two styles of indenting in the same file. Usually the new developer knows nothing about this and doesn't even know tabs are being used, and barely even knows that there's such a thing as configuration for their editor or IDE.

      To me alignment means the start of each line, not aligning arguments (though the problem is there also). How far a line is indented is alignment. If two lines that should be at the same indentation show different amounts of white space in front of them then they are misaligned.

    26. Re:Both? by Darinbob · · Score: 1

      It is utterly irrelvant if "less" can be configured to know tab width. It does not know what the intended tab width is supposed to be for each file. You cannot set it once and have it work for every file. If I configure it to be four spaces instead of eight, then I will still encounter files that want three spaces. There is no universal standard here for how many spaces a tab should be and that is the entire problem - tab stops are not standardized, and the hard tab character is inherently imprecise for display purposes. If you've got 50 different developers all using different ideas of how to indent and what a tab stop should be, and 15 different tools with different defaults, then it's messy as hell.

      This is not just "less", I'm talking about browser based code review tools, online source code browsers, printers, source code control guis, and so forth. If you throw a random file at them they won't know what the intended tab stop is supposed to be. Ok, sure, I can have an alias for "less", "less4", "less8" and such and switch between them but it's clumsy and should not be necessary if people could just learn to avoid hardtabs in files.

      I have worked with files that were meant to use 2, 3, 4, and 8 space tab stops, and it is common for me to run across files where different lines have different intended tab stop settings, so that you cannot just use one tabstop setting and have all the indentation line up properly. I have even seen one file that either used four different tabstop settings (either that or the developers were insane). The developers are (usually) not trying to be disagreeable, most of them don't even know they're using tabs.

      With spaces you never have this problem. You don't have to guess or twiddle with settings until things line up.

    27. Re:Both? by BronsCon · · Score: 1

      To me alignment means the start of each line, not aligning arguments (though the problem is there also).

      To the rest of the industry, alignment is aligning attributes, arguments, operators, or, well... anything else found in the middle of a series of lines.

      How far a line is indented is alignment.

      No, that's indentation. At least, that's what the rest of the industry calls it

      And the problem you're complaining about, where some lines are indented with tabs and others indented with spaces, and those with spaces use varying indent widths, is solved by using tabs. The problem is that tabs and spaces are mixed in the same file.

      Proof: Even if all lines were indented with spaces, the space-indented lines are still inconsistent.

      The problem isn't the use of tabs, the problem is the inconsistent use of spaces and, restating the above in a different way, you would still have that problem regardless of the tabs. Tab indenting is the solution, in this case.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    28. Re:Both? by BronsCon · · Score: 1

      I the width of your tab matters, you're using tabs wrong. Period.

      There is a reason I asked you in the other thread to show me what you're talking about. IT is so that I can point out the real cause of the problem.

      Your comment in that thread that "experience is key" leads me to believe that you think I'm new to this. Boy, I've literally been programming since I was 5. Your mention of 30-40 years of experience leads me to believe that you may be older than me, as I fall at the lower end of that range, but the level of understanding you display renders you a boy in my mind.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    29. Re:Both? by Darinbob · · Score: 1

      No, the problem is that some lines are indented with tabs assumed to be 4 space, and other lines in the same file are intended assuming to be 8 spaces, and forth. Then when looking at the file the lines are are intended to be indented to the same level do not show as lined up visually. It's not good to have differing definitions of tab within a single file, but it does happen and it is a headache.

      Now lots of people will say "if they did everything my way, it would all just work out". That's called having a standard. With tabs there is no standard. There may be a standard for a particular tool or language perhaps but it's certainly not consistent across everything.

    30. Re:Both? by Darinbob · · Score: 1

      I am not using tabs. But I do have to read and modify files used by others. And they most certainly use tabs and many of them use tabs inconsistently (or their tools do).

    31. Re:Both? by umghhh · · Score: 1

      I use tab to produce spaces i.e. I use both. I suppose project given settings for preferred editor + coding guidelines may make some difference.

    32. Re: Both? by BronsCon · · Score: 1

      What the hell editor are you using that doesn't assume a single tab width?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    33. Re:Both? by edtice1559 · · Score: 1

      Almost every IDE can format code. And *good* IDEs will do it perfectly. Unfortunately what they don't do is preserve the original formatting mechanism for future checkins. There's a menu item in Eclipse but I don't know what it is. The key combination is Shift-Ctrl-F to reformat the code. For Java especially, it's super-easy for Eclipse to do this since Eclipse knows what the parse tree looks like. Some formatting utilities can be very weak in they rely on things like regexes and counting brackets which could be error prone. But if you format code by first parsing into the AST and then regenerating the code from that, you'll get an accurate formatting every time.

    34. Re:Both? by BronsCon · · Score: 1

      Unfortunately what they don't do is preserve the original formatting mechanism for future checkins.

      Well, that's what you stated as "the answer" and that's what I was asking.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    35. Re:Both? by BronsCon · · Score: 1

      So you're saying the problem is mixing tabs and spaces for indentation. That's not a problem with tabs and tabs bring an advantage that spaces don't. You've already pointed out how using spaces doesn't fix the problem of inconsistent indent depth, what with some people using 2, 3, 4, 5, 6, or 8 spaces to indent, and some files containing multiple different space-dictated indent depths.

      Using tabs solves that, and when some idiot injects spaces you fix the error. The same should be done in your "only use spaces to indent world"; when you see inconsistent indent depths, decide which one is correct and fix the lines that are incorrectly indented.

      My point is, if you want consistent formatting you have to fix it anyway, so just switch to tabs in the process and keep fixing indentation errors as you find them, just as you should be doing anyway.

      To put it another way, if you're leaving files with mixed tabs and spaces, you're wrong because they should never be mixed (I think we've agreed on that point, that they should never be mixed). If you're removing the tabs but leaving the spaces inconsistent, you're wrong because you still have the inconsistent indentation you're blaming on the tabs (even though you've removed them -- follow that logic, buddy, the problem ain't the damn tabs).

      If you're removing the tabs and updating space-indented lines so they're all consistent, fine, that's one right way to do it. But the compromise is that you're forcing your preference of indent width on everyone else; that's what many of us take issue with. Once your indent widths are consistent, tabs alleviate that issue and everyone can have whatever indent width they want just by specifying their tab width.

      Once again, either way you go you still have to fix indentation errors introduced by lazy developers, assuming you care about that. And if you don't care about that, well, why are you even discussing tab vs space in the first place?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    36. Re:Both? by LostMyBeaver · · Score: 1

      Child, if you are this preoccupied with white space, I wouldn't let you near the git because we adults are to busy working to babysit you.

      I don't give a rats ass what spacing you use so long as your code is consistent and clean.

    37. Re: Both? by Reverend+Green · · Score: 1

      That's what vim's :retab command is for.

    38. Re:Both? by Theovon · · Score: 1

      I would agree, but I use goto in just about every C++ program I write.

    39. Re:Both? by edtice1559 · · Score: 1

      Well if you follow my original suggestion of having the code formatted upon checkin, the local formatting changes don't matter!

    40. Re:Both? by BronsCon · · Score: 1

      I'll grant you that point. However, shouldn't we as professionals be disciplined enough to follow code format specifications for the projects we work on? Yes, we can solve the social problem by technical means, but does that actually solve the social problem, or just hide it and let it fester?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    41. Re: Both? by Your.Master · · Score: 1

      You are assuming that everybody is using the same editor (and that their diff tool is the same as their editor).

    42. Re: Both? by BronsCon · · Score: 1

      Not at all so. I personally use a multitude of editors; primarily my IDE of choice (IntelliJ IDEA), but I can (and often do) use whatever editors exist within the environment I find myself working in, which often ends up being a terminal with access to nano or vim. I use IDEA's diff tool, the POSIX diff command, git's command line diff tools, and occasionally git's GUI diff tools.

      Every single one of them assumes the width of a tab remains the same throughout a given file, because it does. If it doesn't, whoever indented with spaces did something wrong. In addition to that, every single one of them displays tab-indented code exactly as I intend for it to be displayed, properly indented and properly formatted, regardless of the tab width I have set. The only time it's a problem is when some jackhole intermixes spaces and tabs within the same file and their preference does not match my own (or they can't seem to make up their damn mind how wide an indent should be).

      The same can be said of files indented with spaces, of course, withe the caveat that the editor or tool displays space-indented code exactly as the author intended for it to be displayed, which I suppose is fine if there is and will only ever be a single author; that is, if I don't have to edit it. The same caveats apply regarding the mixing of tabs and spaces and being indecisive about the width of an indent.

      That is to say, what you and Darinbob are complaining about is only a problem when someone indents different lines in the same file with varying numbers of spaces. In other words, it's a problem inherent in using spaces for indentation, wherein people get in pissing matches over whether 2, 3, 4, 5, 6, or 8 spaces should be used; this issue and argument is avoided by simply using tabs. Period.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    43. Re:Both? by swilver · · Score: 1

      You know why I think devs that use spaces make more money?

      They're more practical, they realize this debate (and many like it) are pointless wastes of time. Instead they pick a simple option that even the newbs in your team can understand and make that the standard. Then they continue with important issues.

    44. Re:Both? by swilver · · Score: 1

      Agreed. A developer should be able to check in properly formatted code without the use of a formatter. If they can't be precise and accurate enough to do that, then how can I trust them to do anything?

    45. Re:Both? by BronsCon · · Score: 1

      Oh, yes, the "tabs vs spaces" debate is absolutely pointless, I'm not even arguing. You know what's more pointless? The "how many spaces" debate.

      The only reason the "how many spaces" debate comes up is that some people would rather not use tabs and let everyone answer that question for themselves.

      When your employer pays you for hours on end to argue amongst yourselves over the proper number of spaces to indent by, yes, you're going to make more money; the real question is whether or not you're actually earning it during those pointless arguments that could have been avoided.

      Those of us who use tabs avoid those arguments and get more work done, so we might ultimately get paid less but that's only because we bill fewe hours for the same projects because we're more productive.

      At least that's what 3 decades of experience have shown me.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
  3. Only dummies and newbs argue stupid shit by Anonymous Coward · · Score: 5, Insightful

    Proof: neither side makes jack-shit as a coder

    1. Re:Only dummies and newbs argue stupid shit by JaredOfEuropa · · Score: 2

      Just you wait. I bet a PHB is reading this right now, thinking: "If those coders get paid more, they must be better. So it must be the spaces that makes them better. I should go and change our coding standards". And then demand that you actually use the space bar to produce the spaces, in case you're still sneaking tabs in there somehow.

      --
      If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
    2. Re:Only dummies and newbs argue stupid shit by avandesande · · Score: 5, Insightful

      actually a smart PHB would force everyone to use tabs and give them a pay cut

      --
      love is just extroverted narcissism
  4. Survey says by StikyPad · · Score: 4, Insightful

    If the median salary was under $50k, then I'm not sure who they were surveying, but it wasn't professional developers.

    1. Re:Survey says by avandesande · · Score: 1

      People that have been working 10+ years at this don't take surveys.

      --
      love is just extroverted narcissism
    2. Re:Survey says by bobbied · · Score: 1

      At least not in this country... In some places $50K is good money...

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    3. Re:Survey says by __aaclcg7560 · · Score: 1

      At least not in this country...

      Median household income in the US is $57,616 in 2016.

      https://en.wikipedia.org/wiki/Household_income_in_the_United_States

    4. Re:Survey says by drnb · · Score: 3, Informative

      If the median salary was under $50k, then I'm not sure who they were surveying, but it wasn't professional developers.

      Those are global averages. Keep reading and you'll see the region specific charts and numbers. I think the averages for the US were around $100K and $80K.

    5. Re:Survey says by HornWumpus · · Score: 1

      CA median is over 60k$.

      Si Valley median is over 90k$

      In 2013, certainly higher now. That's median for everyone, competent techs should be north of that number.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    6. Re:Survey says by __aaclcg7560 · · Score: 1

      That's median for everyone [...]

      Median means that half make less and half make more. It doesn't mean everyone makes the median.

      [...] competent techs should be north of that number.

      Entry-level tech jobs in Silicon Valley starts off at minimum wage ($10 per hour/$20K per year).

    7. Re:Survey says by HornWumpus · · Score: 1

      Show me one job listing looking for techs in SI valley at $10/hour? Geek squad pays better and has no competent employees.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    8. Re:Survey says by Dog-Cow · · Score: 1

      Most developers live in neither place, you stupid ass-wipe.

    9. Re:Survey says by __aaclcg7560 · · Score: 1

      Show me one job listing looking for techs in SI valley at $10/hour?

      Dell techs who have to drive 200+ miles per week. Those positions are typically available between $10 to $15 per hour. Prior to the last minimum wage increase or two, Dell paid $7.50 per hour.

      One small company I interviewed for in 2014 tried to talk me down into accepting a position at $10 per hour. Since my name was similar to another employee, the recruiter accidentally sent me the salary spreadsheet. All the techs were making $10 per hour.

      Geek squad pays better and has no competent employees.

      They can't be making that much if they're also on the government payroll.

      https://yro.slashdot.org/story/17/05/31/219209/eff-sues-fbi-for-records-about-paid-best-buy-geek-squad-informants

    10. Re:Survey says by Solandri · · Score: 1

      Yeah, my hunch is in a true survey of all programmers, it's the tab-users who make more money. Tabs are a relic from the old typewriter days, so older programmers are more likely to use them. And older programs tend to make more money.

      Tabs worked great on typewriters because they were a fixed size (there was a mechanical stop you could move along notches to set the tab stop length). But when computers came out, they failed to standardize the number of spaces in a tab. So tabs turned into a hindrance which would make code display differently on different computers. I loved tabs on typewriters, and used them extensively on my first computers (for writing reports - before all this networked sharing of files began). But once I had to share what I wrote in software format with others, I switched to using spaces. I only use tabs in Word, which retains the old typewriter ability to manully set the amount of indentation you get from a tab.

    11. Re:Survey says by bobbied · · Score: 1

      Computer techs and programmers are NOT interchangeable... I would imagine their salary requirements are not the same either.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    12. Re:Survey says by bobbied · · Score: 1

      At least not in this country...

      Median household income in the US is $57,616 in 2016.

      https://en.wikipedia.org/wiki/Household_income_in_the_United_States

      We are discussing programmers, which, if you bother to check median salaries for you'd find is well above the national median.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    13. Re:Survey says by __aaclcg7560 · · Score: 1

      Computer techs and programmers are NOT interchangeable...

      The bottom half of IT is techs, the top half of IT is programmers. You can't have one without the other.

      I would imagine their salary requirements are not the same either.

      Bottom half, bottom rates. Top half, top rates. I'm always amused when someone tells me that I should be making $120K+ per year after 20+ years. The problem is I don't work in the top half of IT. I'm a tech, not a programmer.

    14. Re:Survey says by swillden · · Score: 3, Insightful

      Yeah, my hunch is in a true survey of all programmers, it's the tab-users who make more money. Tabs are a relic from the old typewriter days, so older programmers are more likely to use them. And older programs tend to make more money.

      It's the other way around. Old programmers worked on systems where the size of a tab was fixed at 8 spaces and could not be changed. Since 8-space indentation is way too much, they used either a mix of tabs and spaces to get the right indentation level, or spaces only. And then when we all started to get editors with configurable tab sizes, the mixed solution resulted in an unholy mess which was most easily fixed by standardizing on spaces only.

      And old programmers tend to make more money, so money is correlated with spaces-only indentation.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    15. Re:Survey says by sbaker · · Score: 1

      The thing is, TFA says that they controlled for years of experience - and the phenomenon didn't go away.

      They also controlled for a bunch of other effects such as which language is used, what field they worked in, what country they lived in....this makes no sense, other than (somehow) people who use spaces are somehow better programmers.

      The other astounding thing is the HUGE magnitude of the effect. If it was only (say) a thousand dollars different - we'd be laughing this up and calling it a statistical anomaly...but this is EIGHT PERCENT of people's salaries.

      It really doesn't make sense.

      We need to get some industrial-strength statisticians on this - the kind of statisticians who indent their tables with spaces!

      --
      www.sjbaker.org
    16. Re:Survey says by PIBM · · Score: 1

      Interns get > 90k a year or > 45 USD / hour as a starting salary. You are doing it wrong.

    17. Re:Survey says by __aaclcg7560 · · Score: 1

      Obviously, I'm not a programmer.

    18. Re:Survey says by Spacelem · · Score: 1

      When I open up someone else's code, and I find the indentation isn't quite what I find comfortable, I can easily change the tab size and everything magically appears the way I like it. With spaces I have to manually reindent everything to look right.

      Sorry, as far as I'm concerned, it's spaces that are the unholy mess, not tabs. Unless you're talking about right-aligning comments after code, but frankly that's a mess no matter how you try it. At least with tabs the comments line up 3/4s of the time.

    19. Re:Survey says by 50000BTU_barbecue · · Score: 1

      Do you want to be? You talk a lot about programs you write.

      --
      Mostly random stuff.
    20. Re:Survey says by 50000BTU_barbecue · · Score: 1

      Well, you can write programs at home and not be a professional programmer. I guess that's all he said.

      --
      Mostly random stuff.
    21. Re:Survey says by hawk · · Score: 1

      more bluntly, the finding is "Coders not smart enough to configure vim make less than those that do." :)

      hawk

  5. Of course they earn more! by DontBeAMoran · · Score: 5, Funny

    Those idiots take four times longer or more to indent their code compared to those of us who use tabs and get home earlier thus working less hours.

    --
    #DeleteFacebook
    1. Re: Of course they earn more! by JoeyRox · · Score: 1

      Modern editors have an amazing feature which automatically inserts spaces whenever you hit the tab key.

    2. Re: Of course they earn more! by lgw · · Score: 1

      Do they have a feature to automatically go "whoosh" too?

      I'm sure EMACS does. I think it's quadrupal-buckey-shift-Q. No, wait, that's left bracket.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    3. Re:Of course they earn more! by martinfb · · Score: 1

      They are SALARIED, not HOURLY! SPACES per hour do not matter!

      Yet, that is mildly humorous!

      --


      Self-importance and self-indulgence is the root of ALL evil.
  6. Do you have a choice? by godamntheman · · Score: 1

    You're supposed to adopt to the coding style of the project you're working on.

    1. Re:Do you have a choice? by PmanAce · · Score: 1

      4 spaces or a tab (set to indent 4 spaces) is the same thing, resulting in the same coding style no?

      --
      Tired of my customary (Score:1)
    2. Re:Do you have a choice? by bobbied · · Score: 1

      THIS!

      Personally, I don't care about tabs verses spaces, it doesn't make much of a difference to me.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    3. Re:Do you have a choice? by __aaclcg7560 · · Score: 1

      Personally, I don't care about tabs verses spaces, it doesn't make much of a difference to me.

      Unless you Python and get the two mixed up in the same file. That's why your text editor or IDE should have tab set to four spaces.

    4. Re:Do you have a choice? by MightyYar · · Score: 1

      The problem is you don't know what everyone's indent has been set to. I work with files that have tabs that were clearly set to 2, 3, 4, and 8 spaces. I favor 2, but don't really care one whit. If the file uses tabs, I use tabs - if the file uses spaces, I use spaces. My editors all handle this just fine (sometimes with a manual tweak). However, if the file is already a mix of tabs and spaces, then I go with spaces. My OCD would like to change them, but that makes the diff tools show waaaaaay too many changes. Don't poke a crusty turd.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    5. Re:Do you have a choice? by isj · · Score: 1

      [3 spaces]

      I seem to recall that the C examples that came with MS QuickC used an indentation 3. It is the only time I have encountered that in C/C++ code.

    6. Re:Do you have a choice? by godamntheman · · Score: 1

      Yes, all VMware projects use 3-spaces.

    7. Re:Do you have a choice? by lpq · · Score: 1

      You're supposed to adopt to the coding style of the project you're working on.

      Which always seems to be set before you got there.

    8. Re:Do you have a choice? by bobbied · · Score: 2

      Still, it doesn't matter to me, only to the python parser....

      BTW.. Any language that puts requirements on white space (like python) are bad ideas... That stuff when out of style a LONG time before even I started this software engineering thing 25+ years ago and there are good reasons for this.

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    9. Re:Do you have a choice? by __aaclcg7560 · · Score: 1

      Any language that puts requirements on white space (like python) are bad ideas... That stuff when out of style a LONG time before even I started this software engineering thing 25+ years ago and there are good reasons for this.

      I guess someone didn't get the memo when Python came out in 1991 (26 years ago).

    10. Re:Do you have a choice? by bobbied · · Score: 1

      It's still out of style these days....

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
  7. That's because they get paid by the character by JoeyRox · · Score: 5, Funny

    Using spaces increased my earnings by 4x over tabs.

    1. Re:That's because they get paid by the character by maglor_83 · · Score: 1

      I use a 16 character indent. Cha-ching!

  8. Editor by Slalomsk8er · · Score: 2

    I press tab but the editor inserts whatever the project requires. Did the question account for this?

    1. Re:Editor by MightyYar · · Score: 1

      Haha, yup. This. Don't sweat the small stuff.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  9. Do I really need to say it? by Kierthos · · Score: 1

    Correlation is not causation.

    --
    Mr. Hu is not a ninja.
    1. Re:Do I really need to say it? by ndnet · · Score: 1

      Thank you for saying it so I don't have to. Good grief, even the article says it... but only in the last paragraph.

    2. Re:Do I really need to say it? by beelsebob · · Score: 1

      Yep, I'd be willing to take a bet on what the actual causation here is.

      Large tech companies employ a lot of people, and pay a lot of money.
      Most large tech companies use the WebKit style guide.
      The WebKit style guide says to use spaces, not tabs.
      Thus, most people who are getting paid big money are working at a shop that asks them to use spaces.

    3. Re:Do I really need to say it? by JoeRobe · · Score: 1

      How about this (no clue if this is reasonable):
      1) older programmers use spaces, younger use tabs.
      2) older programmers have more seniority leading to higher salary (even if their job title doesn't change).

      ---> programmers that use spaces make more money.

      I work at a company for which the above would be correct, but I'm not a programmer so I don't know if programming positions are similar (increases in pay with seniority while maintaining job title).

      --
      The best way to predict the future is to invent it.
    4. Re:Do I really need to say it? by glenebob · · Score: 1

      Close, but I doubt it has much to do with Webkit. Tabs work great for projects with one developer. Tabs generally seem to turn into a cluster fuck when there's any kind of diversity in the team. Large tech companies means large teams. Tabs mean war in big teams.

    5. Re:Do I really need to say it? by msauve · · Score: 1

      Unless they're getting paid by the character, that is.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    6. Re:Do I really need to say it? by lgw · · Score: 1

      It's a neat idea, but I think you'll find that older programmers are more likely to use tabs. Back in the day, we didn't have the tabs vs spaces war. Everybody just used tabs, and we liked it.

      Kids these days. I'm my day, the keyboard didn't have a tab key, and no insert either! If you wanted to indent more you typed the line over again!

      That's mostly true, BTW. I think there was a tab key, but it didn't do anything useful, and you had to do something really elaborate to shift a range of characters left or right. The bad old days of mainframe coding.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  10. Self explanatory really. by Dishevel · · Score: 1

    Some developers have more space to hold money, and TAB, when you can even find it is expensive.

    --
    Why is it so hard to only have politicians for a few years, then have them go away?
  11. Re:I use spaces but indent by 2 spaces rather than by __aaclcg7560 · · Score: 1

    If you're using two spaces, you probably work at Google. Do they dock your pay for using extra spaces?

  12. Did they take language into account? by RobinH · · Score: 3, Interesting

    I'd think that space vs. tab use is highly dependent on which programming language you're using, and I'd also think that language is correlated with earnings, so I highly doubt this conclusion (if they're trying to conclude anything). Correlation is not causation.

    --
    "I have never let my schooling interfere with my education." - Mark Twain
    1. Re:Did they take language into account? by Anonymous Coward · · Score: 5, Informative

      If only they had a graph that displayed how they checked for your easy explanation and controlled for it.

      Oh wait, they did.

      Have you ever heard of clicking on a link?

    2. Re:Did they take language into account? by Darinbob · · Score: 1

      I couple reasons I think. First, those who have experience have encountered the tabs vs spaces headaches before. Those with less experience may have only used a few languages, have used fewer tools.

      Second, someone who favors precision will tend to favor a space over a tab. People favoring precision tend to get ahead in programming and engineering jobs compared to those who don't mind slack.

  13. Re:I use spaces but indent by 2 spaces rather than by Anonymous Coward · · Score: 1

    I'm going to start using 8 spaces indentation and ask for a raise (i'll report back about how it goes)

  14. Re:I use spaces but indent by 2 spaces rather than by beelsebob · · Score: 1

    No, what it means is that the major tech companies that employ a lot of people, and pay a lot of money all have coding guidelines that say to use spaces.

    I know for a fact the two very big ones use WebKit's style guide as a basis for most of their work, and that it asks you to use spaces.

  15. Reindent by kcdoodle · · Score: 1

    All of my editors do it for me.

    I used to be religious about using a 2 space indent, but I no longer program in Python, so, now, who gives a flip?

    Now I just want my code to look good. In Visual Studio, I do Ctrl-A, Ctrl-K, Ctrl-F, and I don't even know if it does tabs or spaces, and I don't care.

    Also, I agree that those surveyed are incredibly underpaid.

    --

    - I live the greatest adventure anyone could possibly desire. - Tosk the Hunted
  16. How about comments? by bobbied · · Score: 1

    Anybody dare try a study about in code comments and Salary levels?

    My guess is you will see the same difference between Emacs and VI users...

    --
    "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
  17. Who are the people on the graph using both?!? by Gumbercules!! · · Score: 1

    I use tabs and I understand some people prefer spaces but what kind of hybrid-hell-beast uses both??

    1. Re:Who are the people on the graph using both?!? by Kvan · · Score: 1

      If I'm working on an existing codebase I use whatever that uses, and if I'm writing something from scratch I use whatever's the default for the editor I'm using.

      --

      "A *person* is smart. People are dumb, panicky, dangerous animals and you know it."
      - 'K' in Men in Black.

    2. Re:Who are the people on the graph using both?!? by MightyYar · · Score: 1

      I work on several projects with hundreds of different contributors. I just use whatever is there (sometimes within the same file!). So count me as "both" - though I prefer 2 spaces in general. I have to admit using a lot of 4 spaces in Python since that's what the editors seem to default to and it looks nice.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    3. Re:Who are the people on the graph using both?!? by Wraithlyn · · Score: 1

      People that work with multiple file formats?

      For instance YML specifies that spaces must be used.

      Either way, everyone should be using .editorconfig these days.

      --
      "Mind, as manifested by the capacity to make choices, is to some extent present in every electron." -Freeman Dyson
    4. Re:Who are the people on the graph using both?!? by Gumbercules!! · · Score: 1

      Ok everyone - it was a joke...

    5. Re:Who are the people on the graph using both?!? by Misagon · · Score: 1

      There could be many explanations:
      * GNU style formatting of block statements put braces on their own lines, indented half-way.

      * Respondents refer not to left-side indentation but to how they line up comments, member names, parameters etc. This can be fidgety when using tabs only (unless you are using elastic tabs) and using spaces for this would make it independent of tab size.

      * Other things indented half-way: Preprocessor statements, labels, etc. Indenting of #ifdef's around code become independent of the code it surrounds, switch-case statements don't become so deep. You could also argue that classes (and functions...) become more readable.

      --
      "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
    6. Re:Who are the people on the graph using both?!? by locofungus · · Score: 1


      <tab>this line...........//1 tab, 9 characters, 11 spaces to comment
      <tab><tab>new level......//2 tabs, 9 characters, 6 spaces

      Indenting only works when you have a fixed space (5 in this case) tab width.

      Even if you decide to deny the ability to line up comments across different indent levels, I've not come across an editor that can correctly insert tabs and spaces into the blank line you add to get across to the RH side to continue your comment.

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
  18. Re:Yeah but by Coisiche · · Score: 4, Funny

    Most of the respondents wouldn't have understand the question because they actually use whatever their IDE does.

  19. And the smart ones by oshkrozz · · Score: 1

    Use Notepad++ and just convert all the Tabs to 4 spaces so they get paid more and work less ...

  20. Eclipse serializes with spaces or tabs by prefec2 · · Score: 4, Informative

    Modern IDEs format code automatically and use spaces or tabs based on your settings. In addition, the auto formatter automatically adds whitespace when you go into the next line. It is most likely not a real dependency between whitespace and salaries, but it has more to do with which environment they use.

    1. Re:Eclipse serializes with spaces or tabs by Darinbob · · Score: 1

      So salary difference dividing up those who use default settings (almost always tabs for some bizarre reason) versus those who go through and learn how their tools work and how to get the most out of them.

  21. Charming and fun, but not informative by TimothyHollins · · Score: 2, Insightful

    Let's say that using spaces was taught in the 70s, while tabs was taught in the 80s.

    Now let's say we ask people for their style and their income. The older programmers that by now make more money will say they use spaces, while the younger programmers will say tabs. This would account for the differences.

    In short, this survey isn't providing enough data to control for any factor, and the likelihood that tabs and spaces actually impact the earnings of any programmer is 0.

    Also, any programmer that uses spaces is going to Hell (which runs Windows ME on the user machines)

    1. Re:Charming and fun, but not informative by HornWumpus · · Score: 1

      At these Salaries? The explanation is that only newbies answered the poll.

      The tab/space 'debate' has been going on so long that 'tabs produce smaller files' was once a valid argument.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    2. Re:Charming and fun, but not informative by angel'o'sphere · · Score: 1

      UCSD Pascal on Apple ][ runlength encoded the indentation.
      That actually really saved quite some space.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Charming and fun, but not informative by HornWumpus · · Score: 1

      Damn, we're old...I remember that.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    4. Re:Charming and fun, but not informative by Darinbob · · Score: 1

      I started int he 80s. The vi editor default settings would change some spaces to tabs automatically, giving the same layout but conserving a few characters. This was in the days of not having manuals handy and certainly no built in help. So I had noticed this but didn't know how to fix it, but being a noob I didn't worry about it. Until I had to use Occam which used indentation for structure (later borrowed by Python), so when vi converted the spaces to tabs it would cause compilation errors. At that point I had to make a major effort to get some documentation about how to configure things to stop doing that.

      My guess at the time was that in the 70s it was more important to save characters and thus tabs were preferred (witness the sheer sparseness of comments and short variable names in Unix source). Back then a tab stop was almost always meant 8 characters, especially since any change would mean your printouts would come out wrong.

  22. Space bar vs tab key by drnb · · Score: 1

    Most of the respondents wouldn't have understand the question because they actually use whatever their IDE does.

    I read some of the comments expecting amusement, I was not disappointed. One specifically thought spaces-favoring developers were using the space bar rather than the tab key.

    1. Re:Space bar vs tab key by gweihir · · Score: 1

      That would indicate that the dumb ones are on the side of the tab. Maybe they do not even know how indention using spaces works or that a sane editor does most of it automatically.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  23. How much money... by AC-x · · Score: 1

    How much money do developers who let their damn IDE do the indenting for them make? :)

    1. Re:How much money... by Tailhook · · Score: 1

      Good question. Not 100% sure I'd notice what some of the tools I use are doing wrt spaces vs. tabs. If a good formatting tool is available I will NOT manually format code. Don't care how unfortunate the result is; bang on the 'format source code' key and stop thinking about it. I don't think any one of webstorm, qtcreator, visual studio, vscode or netbeans are using tabs, but as I said; it's possible I might not notice if they did. The one thing I can affirm with metaphysical certitude is set ts=4;set sw=4;set expandtab.

      --
      Maw! Fire up the karma burner!
  24. I write ... by PPH · · Score: 1

    ... obfuscated C. What's white space?

    --
    Have gnu, will travel.
  25. Re:$59,140 and $43,750 are the medians? by drnb · · Score: 1

    Damn, that's starting wages for someone right out of school! Maybe I should stop using tabs AND spaces.

    Those are global averages. Keep reading and you'll see the region specific charts and numbers.

  26. Alternate interpretation of the data by Comboman · · Score: 5, Informative

    Programmers who use spaces are more likely to lie about how much money they make.

    --
    Support Right To Repair Legislation.
  27. Bad Statistics. by jellomizer · · Score: 1

    There is a lot of questions out there, that these numbers don't seem to show.
    1. Which languages do they use primarily. Python for example while can handle tabs, your code needs to be consistent so using spacing is better. Normally you also set the IDE to replace tab with spaces. Other languages that don't care about white space may allow tabs and spaces to be mixed.
    2. What type of projects are they working on. Larger projects with mutable developers need to keep their coding style more or less synchronized. Space intents are normally preferred as tab spacing will be inconsistent across system settings.
    3. Is this based on code review. If so, does the IDE just replace Tabs with spaces.

    I myself am normally will follow the Tab key, with the IDE replacing it with spaces. As the Tab takes one keypress and makes jagged ends often move to the correct tab point (Still an IDE thing)

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  28. cause vs correlation. by fish_in_the_c · · Score: 1, Insightful

    This is probably an excellent example of where cause and correlation are not the same thing.
    Here is my suspicion, as an old programmer. The REASON why spaces are encourage over tables is for consistency of printing on a physical paper.
    Which is unimportant or irrelevant if you are not. a) doing code reviews where you are passing out dead tree copies like may have been done 10 to 15 years ago OR b) submitting source code formatted on word docs as some part of documentation to a customer as government contractors are some times required to do.

    SOOO.... my hypothesis is that most people who regularly used spaces and were trained when it matters are either senior developers ( who tend to make more money) or working in government contracting, thus being the cause of the correlation noticed in the study. Of coarse without gathering enough data to control for the those variables you cannot have certainty of the answer. The original post doesn't include age of developer in it's data set as near as I can see , which to me is a obvious omission if you want to actually say anything useful about salary vs habits as many habbits will track with 'when' you trained.

    --
    âoeTolerance applies only to persons, but never to truth. Intolerance applies only to truth, but never to persons.
    1. Re:cause vs correlation. by Baron_Yam · · Score: 1

      >Here is my suspicion, as an old programmer. The REASON why spaces are encourage over tables is for consistency of printing on a physical paper.

      Not just. I tend to use tabs because hey, 5 spaces for one key press, and also because it aligns non-proportional fonts.

      However, MS SQL is inconsistent in its rendering of tabs. If I copy code from a script window to a SQL Agent job, everything looks like garbage... so sometimes spaces win out.

      I suspect a good part of the spaces vs. tabs debate ignores what environment the developer is working in.

    2. Re:cause vs correlation. by kiminator · · Score: 1

      There may also be policies related to use of spaces vs. tabs at the specific companies people work for. For example, Google's C++ style guide requires using spaces for indentation.

      My experience has been that spaces are markedly superior to tabs in shared projects, for the reason that different developers are likely to have different editor settings. If I write some code, I might not realize at the time of writing that I've accidentally mixed some tabs and some spaces. But the moment I send the code to somebody else who uses a different editor with a different tab setting, that code will have weird formatting. And even if the original author was consistent about using tabs everywhere, a different tab setting would make lines end at different locations, potentially making for odd line breaks.

      I'd be willing to bet that this consistency argument makes it so that companies working on large codebases with lots of developers are more likely to require use of spaces than not, and they probably also have higher salaries.

  29. OB Scene from "Silicon Valley" by Leomania · · Score: 3, Informative
    --
    You don't use science to show that you're right, you use science to become right.
  30. Re:$59,140 and $43,750 are the medians? by freak0fnature · · Score: 1

    We had one guy right out of college demanding $80k...we didn't hire him because he was an ass...but salary.com has 49k-84k for entry level for my area.

  31. Principles by bill_mcgonigle · · Score: 1

    Sure, if you sell your soul to the devil you can make a ton of money working for the Banksters or the Military Industrial Complex.

    Am I late for the holy war?

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  32. Why not make it a default? by WDot · · Score: 1

    If spaces are so great, why not make it more of a default in text editors and IDEs? When I get a new machine or start using a new tool, I might write a whole bunch of code using the default tabs, then realize that my Python interpreter complains about mixing tabs and spaces.

    1. Re:Why not make it a default? by QuietLagoon · · Score: 1

      ... Python interpreter complains about mixing tabs and spaces....

      Really? I had heard a lot of good things about Python. But if it get confused when spaces and tabs are used interchangeable, that's pretty bad.

    2. Re:Why not make it a default? by Rockoon · · Score: 1

      Yes. Python is basically the edge case of white space in programming. I dont know why it is that they thought that it would be a good idea to ride on the edge case. Its never a good idea to ride on an edge case.

      --
      "His name was James Damore."
    3. Re:Why not make it a default? by itsdapead · · Score: 1

      But if it get confused when spaces and tabs are used interchangeable, that's pretty bad.

      I think that's by design to punish anybody who deviates from whatever the One True Indentation Style is this week. I'm only surprised that Python 2 doesn't require tabs and Python 3 spaces.

      Any good thing said about Python comes from a person who can't see any problem with significant white space and never read the 20th Century "Thompson & Richie admit than Unix was a practical joke" email (in which significant whitespace in makefiles was "evidence").

      Tried Python once - gritted my teeth and decided to get over the whitespace thing, flipped a coin to get over the whole "Python 2 or 3" thing... started on a little project... needed XML DOM and XPATH libraries so looked around and found about 4 half-written subsets plus a long argument about how DOM could be implemented in a truly "pythonesque" fashion - gave up and went back to another well-known scripting language beginning with a 'p' (tm) that is admittedly a pile of festering shit in terms of elegance and purity, but which offered bindings for the ubiquitous Apache XML libraries and thus got the job done.

      Admittedly, that was years ago. so maybe they've found a way of implementing that particular requirement in a way that won't alert the Spanish Inquisition to break out the Comfy Chair. Maybe they've even sorted the "3rd Version of Python vs. Python Version 2" schism. Since all the evidence suggests that some people have managed to write substantial software in it, I might give it another spin someday, but my general feeling is that its just gratuitously different from C-descended-or-inspired syntax the sake of it.

      It does have the advantage that it's not (AFAIK) indentured to Microsoft (C#), Apple (Swift), Oracle (Java) or Google (what day is it?) and doesn't promote mono-paradigm zealotry, so it might be a good choice for teaching principles.

      --
      In a survey of 100 programmers, 111111 thought that duck-typing was a good idea.
    4. Re:Why not make it a default? by QuietLagoon · · Score: 1

      ... Indentation in Python is syntactic. It's how lexical scope is expressed. ...

      OK, thanks for the explanation. It is worse than I had thought.

  33. The real question... by crashumbc · · Score: 5, Funny

    One space or two after a period?

    Sorry wrong crowd :P

    (and don't you heathens dare say one)

    1. Re:The real question... by whoever57 · · Score: 1

      One space or two after a period?

      The question is another example of why you should be using tabs.

      Obviously one space is the right answer: the tool should provide the appropriate spacing without the user having to hit another key. If you need to hit space twice, then your tool is deficient.

      Similarly, tabs allow better control of indentation without the need for either the user or the tool to insert multiple characters.

      --
      The real "Libtards" are the Libertarians!
    2. Re:The real question... by Tihstae · · Score: 1

      One space or two after a period?

      Sorry wrong crowd :P

      (and don't you heathens dare say one)

      It is two when using a typewriter. :-)

    3. Re:The real question... by Anonymous Coward · · Score: 2, Funny

      I always give my wife plenty of space when she's on her period, and for a day or so after.

    4. Re:The real question... by R3d+M3rcury · · Score: 1
    5. Re:The real question... by is+as+us+Infinite · · Score: 1

      Hey you insensitive clod, I use a single tab after each period. It's much better for readability. Your eye skips directly to the beginning of each sentence and sometimes your tabs even line up, creating meaning that didn't even exist before. Also, it makes the spacing a little bit variable so you get this very organic feeling to what you're writing. It's just the best and I recommend it to everybody who writes paragraphs in English++ (or even English#).

      --
      Quidquid latine dictum sit, altum sonatur. . . . . . . .
    6. Re:The real question... by is+as+us+Infinite · · Score: 1

      Oh no! Slashdot has removeth my tabs. I am become undone!

      --
      Quidquid latine dictum sit, altum sonatur. . . . . . . .
    7. Re:The real question... by sl3xd · · Score: 3, Informative

      It is two when using a typewriter. :-)

      I learned to type with a typewriter, and back then most printers had a single fixed-width font, so it was still considered proper form to double-space after a period.

      It wasn't until a couple years ago I learned that it wasn't considered proper form to double-space; decades of muscle memory are hard to unlearn.

      --
      -- Sometimes you have to turn the lights off in order to see.
    8. Re:The real question... by sl3xd · · Score: 1

      I had the same problem with LaTeX and LyX. Took ages to get used to...

      --
      -- Sometimes you have to turn the lights off in order to see.
    9. Re:The real question... by tepples · · Score: 1

      One space or two after a period?

      the tool should provide the appropriate spacing without the user having to hit another key. If you need to hit space twice, then your tool is deficient.

      I want to make my writing tool no longer deficient. How do I make it distinguish the end of a sentence from the end of an abbreviation?

    10. Re:The real question... by linear+a · · Score: 1

      Two spaces after a period except for just one space after the period that ends a paragraph.

    11. Re:The real question... by Darinbob · · Score: 1

      For typewriter, it's two. With such things becoming more rare, I think it's up for debate now. Muscle memory means it's hard to stop the two spaces.

      But any good word processor or typesetting tool will treat them both the same anyway. One space or one hundred spaces should make no difference. Of course, a lot of these tools just plain suck. Which is why I always preferred TeX or LaTeX back when I wrote papers and Word was a cruel joke.

    12. Re:The real question... by swillden · · Score: 1

      One space or two after a period?

      Sorry wrong crowd :P

      (and don't you heathens dare say one)

      The correct answer depends on the font. With monospaced fonts, two spaces after a period. With proportional fonts, it's up to the rendering system to recognize the end of the sentence and render the single space after a period as an em space. A good rendering system should recognize periods in abbreviations, and use a smaller space. But few do, so we just live with the egregiously large space in the middle of "Mr. Green".

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    13. Re:The real question... by DRJlaw · · Score: 1

      It wasn't until a couple years ago I learned that it wasn't considered proper form to double-space; decades of muscle memory are hard to unlearn.

      Nobody has ever suggested to me that it is improper form. In my opinion, it still makes paragraphs more easily readable. I'm also old enough that if someone were to suggest to me that it was improper form I could safely ignore them.

      Now get off my used-to-be-fixed-spaced lawn.

    14. Re:The real question... by z3alot · · Score: 1

      In latex, to force word spacing after an abbreviation, you escape the space like '\ '. I suppose if it has to be spaced as a text document, the editor should unconditionally insert two spaces after a period, then in the case of an abreviation the user should backspace.

    15. Re:The real question... by michael_wojcik · · Score: 1

      The real error here is the appeal to "considered proper form".

      None of these conventions of mechanics, usage, or typography are "proper" in any real sense. They are at best the highly subjective dictates of house style sheets and style guides for writers, generally no more than a reflection of the whims and prejudices of some senior editor or author.

      In some cases, they're supported by the requirements of typographers - that's the source of the "punctuation inside closing quotation mark" convention - but such rules are now mostly or entirely atavistic. Others claim to derive from various authorities that, on cursory inspection, have no authority at all; the Augustan invention and vilification of the "split infinitive" is the classic example. ("You can't do it in Latin, so you shouldn't be allowed to do it in English.")

      Ultimately none of these rules are anything more than codified, contested personal preferences, and their only claim to be "proper form" is what little support they can gain through popularity. And that propriety is fickle.

  34. Possible Explanation... by sycodon · · Score: 3, Interesting

    Using spaces to indent is really kind of an OCD thing to do. There's the time and the counting and then redoing when you change something.

    So maybe the real lesson is the OCD programmers make a bit more than non-OCD programmers.

    --
    When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
    1. Re:Possible Explanation... by krotscheck · · Score: 2

      Alternative explanation: People who use spaces have gotten so annoyed at how much a PITA formatting is, wrote an autoformatter, and have suddenly reclaimed all that time they would have otherwise spent formatting.

      --
      This signature can save you $400 on your car insurance!
    2. Re:Possible Explanation... by donaldm · · Score: 3, Insightful

      Using spaces to indent is really kind of an OCD thing to do. There's the time and the counting and then redoing when you change something.

      So maybe the real lesson is the OCD programmers make a bit more than non-OCD programmers.

      If you are using a decent text editor (eg. gvim and emacs to name two) indentation is actually done by the editor and is fully customizable, all you as the coder has to do is make sure that what you are coding has as few errors as possible. If you have to worry about indentation then you are not doing it right.

      --
      There ain't no such thing as proprietary standards only proprietary formats. Standards are by definition open.
    3. Re:Possible Explanation... by ShanghaiBill · · Score: 4, Informative

      Using spaces to indent is really kind of an OCD thing to do. There's the time and the counting and then redoing when you change something.

      Uhh .. no. Whether you use tabs or spaces is an editor config setting. At the human UI level it is barely even noticeable.

      I use spaces at work so the code looks the same for everyone. For Python, I always use spaces since whitespace is part of the syntax. For other languages, I am not even sure. I would need to look at my .emacs file.

    4. Re:Possible Explanation... by Rockoon · · Score: 2

      Using spaces to indent is really kind of an OCD thing to do. There's the time and the counting and then redoing when you change something.

      If you think that there is a lot of counting, its because you have a ridiculous tab setting. It should be 2.

      --
      "His name was James Damore."
    5. Re:Possible Explanation... by DrStrangluv · · Score: 5, Interesting

      > For Python, I always use spaces since whitespace is part of the syntax. For other languages, I am not even sure. I would need to look at my .emacs file.

      I think you've hit the crux of it. Emacs, Visual Studio, and Eclipse (at least) all use tabs by default. What we may be seeing is a selection for people who know enough about their environment to configure it to work for them.

    6. Re:Possible Explanation... by serviscope_minor · · Score: 2

      I use spaces at work so the code looks the same for everyone.

      I use tabs so the code looks how everyone wants it to look. Like 4 spaces per indent? set ts=4. Like 8? Use set ts=8. etc.

      For Python, I always use spaces since whitespace is part of the syntax.

      For python I use a mix of spaces and tabs because I'm a shithead.

      --
      SJW n. One who posts facts.
    7. Re:Possible Explanation... by Gr8Apes · · Score: 5, Insightful

      The whole spaces vs tabs argument is so 90s, and seems more like arguing whether cow or bull leather whips are better.

      Intelligent devs use IDEs that handle all this formatting nonsense for them, removing the entire argument in the first place and just get things done. If your preferred language doesn't have a modern IDE that handles this for you, perhaps that tells you all you need to know about your preferred language.

      --
      The cesspool just got a check and balance.
    8. Re:Possible Explanation... by Grishnakh · · Score: 1

      The only benefit tabs had/has is the ability to visually change how much indentation they represent on the fly without modifying the content. ... you can quickly switch back and forth at will, with no impact on the data in the document. While I do recall using that decades ago, I can't remember the last time I needed/wanted to do that.

      It's useful when you're not the only person working on that code, and your cow-orkers have different ideas of how many spaces each indentation level should be. If you have one weirdo on the team who insists on 8-space or 2-space indents, then using tabs keeps you from fighting over this all the time and filling up the git repo with constant whitespace changes.

    9. Re:Possible Explanation... by ShanghaiBill · · Score: 5, Funny

      It should be 2.

      It depends on the language. For bracketed languages like C++, Java, and Javascript, 2 spaces is correct. But for indented languages like Python, 4 is better to make the structure more clear.

      What I really can't stand is people that use 8. That is never the right choice. My wife uses 8 spaces, and we have had plenty of arguments over that, especially when she edits my code, changes the indentation and then checks it back into the git repository with 100% of lines changed. But the final straw was when she started teaching the kids to use 8 spaces. We almost got divorced over that. I fought for 2, she fought for 8, so we compromised, and the kids are using 4 space indents, although neither of us is happy about that.

    10. Re:Possible Explanation... by ausekilis · · Score: 1

      The only benefit tabs had/has is the ability to visually change how much indentation they represent on the fly without modifying the content. ... you can quickly switch back and forth at will, with no impact on the data in the document. While I do recall using that decades ago, I can't remember the last time I needed/wanted to do that.

      It's useful when you're not the only person working on that code, and your cow-orkers have different ideas of how many spaces each indentation level should be. If you have one weirdo on the team who insists on 8-space or 2-space indents, then using tabs keeps you from fighting over this all the time and filling up the git repo with constant whitespace changes.

      Or you can use and IDE/git repo manager with a setting to ignore whitespace differences.

    11. Re:Possible Explanation... by amicusNYCL · · Score: 5, Insightful

      Plopping something like this at the top of your file can help too:
      # ex: set tabstop=4 expandtab smarttab softtabstop=4 shiftwidth=4:
      # -*- Mode: tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- #
      (if your editor doesn't know what to do with those, it's not worthy of use)

      I delete that cruft when I encounter it. Editor settings belong in an editor, not in my code, thank you very much.

      --
      "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
    12. Re:Possible Explanation... by 0100010001010011 · · Score: 5, Funny

      Intelligent devs use IDEs

      Would that be vim or emacs?

    13. Re:Possible Explanation... by skids · · Score: 2

      If you have to worry about indentation then you are not doing it right.

      Or you care what your code looks like more than any automated algorithm ever could.

      Though lately I've been making an effort to use tabs because I've been working on WRT stuff where every byte saved is worth something.

    14. Re:Possible Explanation... by Anonymous Coward · · Score: 5, Funny

      What I really can't stand is people that use 8. That is never the right choice. My wife uses 8 spaces, and we have had plenty of arguments over that, especially when she edits my code, changes the indentation and then checks it back into the git repository with 100% of lines changed. But the final straw was when she started teaching the kids to use 8 spaces. We almost got divorced over that. I fought for 2, she fought for 8, so we compromised, and the kids are using 4 space indents, although neither of us is happy about that.

      This is why it is so important to get to know each other before getting married. My church recommends starting an open-source project together before even getting engaged, you learn so much about a person just settling on which license to use.

    15. Re:Possible Explanation... by minogully · · Score: 1

      I use spaces at work so the code looks the same for everyone.

      I use tabs so the code looks how everyone wants it to look. Like 4 spaces per indent? set ts=4. Like 8? Use set ts=8. etc.

      Both of these reasons are exactly why I use a combination of tabs and spaces. All Tabs for regular code indentation, but when I need to split a line of code across multiple lines I use tabs up to the point of the regular code's indentation, then spaces afterwards since the extra indentation for readability is usually lined up with some piece of code from the line before.

      This ensures that for everyone, they will both see it how they want it to look AND the code won't get misaligned in these circumstances. Unfortunately, Eclipse doesn't automatically do it this way.

    16. Re:Possible Explanation... by greythax · · Score: 4, Insightful

      And truly intelligent devs check the "use spaces instead of tabs for formatting" in the options of their IDE...

    17. Re:Possible Explanation... by SCVonSteroids · · Score: 2

      An excellent solution to your situation would be for your entire family to use no spaces.
      You all get to spend time closer together as a result!

      --
      I tend to rant.
    18. Re:Possible Explanation... by computational+super · · Score: 1

      See and here I was thinking that the developers who get paid more are the ones who get paid by the hour and type "space space space space space" to begin every line.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    19. Re:Possible Explanation... by religionofpeas · · Score: 1

      If you have one weirdo on the team who insists on 8-space or 2-space indents, then using tabs keeps you from fighting over this all the time and filling up the git repo with constant whitespace changes.

      Except when there's a mix of tabs and spaces.

    20. Re:Possible Explanation... by lgw · · Score: 1

      I use tabs so the code looks how everyone wants it to look. Like 4 spaces per indent? set ts=4. Like 8? Use set ts=8. etc.

      Worrying about that is a sign of too much OCD. Code is code regardless of formatting. But if you indent more than 4 you're a heretic who will be first up against the wall when the revolution comes! Ahem.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    21. Re:Possible Explanation... by DickBreath · · Score: 2

      > argument is so 90s, and seems more like
      > arguing whether cow or bull leather whips are better.

      Bull leather whips work better.

      Most employers would agree.

      --

      I'll see your senator, and I'll raise you two judges.
    22. Re: Possible Explanation... by Anonymous Coward · · Score: 1

      The fastest route to a pay raise.

    23. Re:Possible Explanation... by Cederic · · Score: 1

      Then fucking compile the code instead of shipping the source and running it dynamically on the fly - given that's the only way the source code formatting would ever get anywhere fucking near the device on which you're running.

      I think you just demonstrated a core reason for the pay differential.

    24. Re:Possible Explanation... by Cederic · · Score: 1

      So how the fuck did neither of you think to use a pretty-printer on check-in/out so that you can both work at your preferred indentation without fucking over the change record?

    25. Re:Possible Explanation... by swillden · · Score: 1

      Intelligent devs use IDEs that handle all this formatting nonsense for them, removing the entire argument in the first place and just get things done

      I see you're a novice programmer.

      IDEs do not solve this problem; they just hide it, in a way that arguably makes it worse. I made your same argument 25 years ago, saying that decent editors (like EMACS, still my editor of choice) handle all that nonsense, removing the entire argument. So, I had EMACS configured to use an optimal mix of (proper 8-space) tabs and spaces, and life was good.

      Then others had to edit my code, and they cursed me, because they used tabs only, and set their tab width to the indentation level, and my code was all misaligned in their editor, and hard to read. So they "fixed" my code, and life was good.

      Then others had to edit their code, and they also used tabs only, but set their tab width to a different preferred indentation level; and lots of carefully aligned code became misaligned, and hard to read. So they fixed the code to use a correct number of tabs for indentation levels, and then spaces after that for alignment (which is how their editors/IDEs were configured).

      And then the code came back to me, and although the alignment was fine, my 8-space tabs pushed much of the code way to the right. So then I told my editor to reformat and replace all the tabs with appropriate numbers of spaces....

      And it looked right in everyone's editors, IDEs, and when printed, and cat'ed, and everything else. It did mean that people couldn't easily use different indentation levels, but that's a small price to pay.

      So... the right answer is spaces. Which is what all the old hands have learned. And old hands make more money than young novices. So this finding of correlation between salary and using only spaces makes perfect sense.

      However, I've since moved on to another approach to code formatting: I do not format code. I write a configuration file for a code formatter (I'm really liking clang-format lately), and I check it in with the code, and I add a commit hook that runs all code through the formatter, with the specified config, and rejects the commit if the output of the code does not match the input.

      Use whatever tool you want to edit, but you have to run the formatter before you can commit. If you're an intelligent developer, then, what you'll do is bind the formatter to a hotkey in your editor/IDE and never worry about formatting at all. I almost never hit the return key while typing code, and don't bother much with spaces or at all with tabs. I type stream-of-consciousness, format-free code, then hit the formatter hotkey.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    26. Re:Possible Explanation... by Gr8Apes · · Score: 2

      You've missed my point. IDEs should handle formatting into whatever you wish to see, and the storage format should store code, for which all white space after the initial demarcation is redundant. I personally despise spaces, as I generally have no use for them at all past 1. Tabs are better IMNSHO because they eliminate extra spaces, but they're still not awesome. Either way, my IDE works with spaces and tabs and deals with the formatting as necessary, so a proper project config file removes any formatting issues as far as coding standards of the day go.

      BTW, as far as I'm concerned, any language that is whitespace dependent isn't really a candidate for a usable language. We'll throw that out there as well.

      --
      The cesspool just got a check and balance.
    27. Re:Possible Explanation... by Gr8Apes · · Score: 1

      I'd mod you funny if I could. Awesome.

      --
      The cesspool just got a check and balance.
    28. Re:Possible Explanation... by swillden · · Score: 1

      This ensures that for everyone, they will both see it how they want it to look AND the code won't get misaligned in these circumstances.

      And it ensures that for those who use proper 8-space tabs indentation gets shoved way to the right. Which is also what happens when the code is cat'ed on a terminal, looked at in a diff program, etc., unless you configure tabs to be smaller in all of those other contexts... and then other things that expect tabs to have the correct size get broken.

      No, spaces only is the best overall answer.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    29. Re: Possible Explanation... by Gr8Apes · · Score: 1

      vim definitely has formatting capabilities but I generally don't use them much. My vim usage is very specific to certain functions that just work better in vim than any purpose built IDE I've ever come across, and also for a consistent editor experience across all platforms I deal with. Emacs never grew on me, but I started with vim first, which is probably why.

      --
      The cesspool just got a check and balance.
    30. Re:Possible Explanation... by Gr8Apes · · Score: 1

      Intelligent devs shouldn't need an IDE to help them format their code properly.

      But it certainly makes them more productive by removing a bunch of manual steps.

      --
      The cesspool just got a check and balance.
    31. Re:Possible Explanation... by Gr8Apes · · Score: 1

      Intelligent devs use IDEs that handle all this formatting nonsense for them, removing the entire argument in the first place and just get things done

      I see you're a novice programmer.

      Quite the contrary:

      So... the right answer is spaces.

      Actually, it is the LCD answer to viewing code, equivalent to everyone coding in Comic Sans typeface because it's on everyone's system. (yes, purposefully said to indicate the square peg / round hole problem)

      Now for a more appropriate answer:

      However, I've since moved on to another approach to code formatting: I do not format code. I write a configuration file for a code formatter (I'm really liking clang-format lately), and I check it in with the code, and I add a commit hook that runs all code through the formatter, with the specified config, and rejects the commit if the output of the code does not match the input.

      Use whatever tool you want to edit, but you have to run the formatter before you can commit. If you're an intelligent developer, then, what you'll do is bind the formatter to a hotkey in your editor/IDE and never worry about formatting at all. I almost never hit the return key while typing code, and don't bother much with spaces or at all with tabs. I type stream-of-consciousness, format-free code, then hit the formatter hotkey.

      Thanks for agreeing with "Intelligent devs use IDEs that handle all this formatting nonsense for them" because my IDEs incorporate exactly this solution and it is done automatically without even thinking about it. Some of us have been doing that for more than a decade, hence the statement that this is so reminiscent of the 90s.

      --
      The cesspool just got a check and balance.
    32. Re:Possible Explanation... by Darinbob · · Score: 1

      Nobody hits the space bar 4 times to indent. You use the tab key and the editor puts in 4 spaces. There's no OCD involved here.

    33. Re:Possible Explanation... by Darinbob · · Score: 1

      And the other person who's trying to use your file has to guess. And guessing turns out to be hard when the file uses more than one tab stop setting (and this is extremely common).

    34. Re:Possible Explanation... by sycodon · · Score: 1

      Just behind the head?

      --
      When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
    35. Re:Possible Explanation... by sycodon · · Score: 1

      Man, you try to complement some people and they lose their shit.

      LOL!

      --
      When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
    36. Re:Possible Explanation... by Hognoxious · · Score: 1

      If twp spaces of indentation is too small for you to see you should get your eyes checked.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    37. Re:Possible Explanation... by roman_mir · · Score: 1

      Personally I hate spaces. I just hate them and that's that. I hate everything about them. The way they get the largest key on the keyboard, what are they compensating for?

      Of-course I do like money, I like money quite a bit and I would like to get more money so here is what I am going to do. I am going to use spaces for a while and see if I start making more money.

      I will start using spaces and then I will demand a raise and see how that goes. Of-course I know how that goes because I know who will be handling the demand. I will demand more money and I will have to approve that demand so... but who knows, maybe I will look at all those spaces and will appreciate them so much that I will give me a raise!

    38. Re:Possible Explanation... by ShanghaiBill · · Score: 1

      So how the fuck did neither of you think to use a pretty-printer on check-in/out

      I suggested that to her attorney during the mediation process, but I don't think he understood. The 4 space indent is the only formatting requirement that made it into the final settlement.

    39. Re:Possible Explanation... by swillden · · Score: 1

      Did you intend that to be in reply to a different post? I don't see how it's related to what I said.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    40. Re: Possible Explanation... by CAIMLAS · · Score: 1

      I personally use whatever, but its irritating to work on other's code which isn't using what I use by default - because then I've got to go through and reformat.

      --
      ~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
    41. Re: Possible Explanation... by tattood · · Score: 1

      Sublime Text has an option to use spaces or tabs for when the tab key is used.

      --
      WTB [sig], PST!!!
    42. Re:Possible Explanation... by swillden · · Score: 1

      However, I've since moved on to another approach to code formatting: I do not format code. I write a configuration file for a code formatter (I'm really liking clang-format lately), and I check it in with the code, and I add a commit hook that runs all code through the formatter, with the specified config, and rejects the commit if the output of the code does not match the input.

      Use whatever tool you want to edit, but you have to run the formatter before you can commit. If you're an intelligent developer, then, what you'll do is bind the formatter to a hotkey in your editor/IDE and never worry about formatting at all. I almost never hit the return key while typing code, and don't bother much with spaces or at all with tabs. I type stream-of-consciousness, format-free code, then hit the formatter hotkey.

      Thanks for agreeing with "Intelligent devs use IDEs that handle all this formatting nonsense for them" because my IDEs incorporate exactly this solution and it is done automatically without even thinking about it.

      Your IDE alone cannot incorporate that solution, unless you can force everyone to use the same IDE and you can enforce everyone's IDE to be configured identically. To make it work you really need a standalone tool that you can integrate with source control.

      And unless you force everyone to use the same IDE, you still need the spaces-only LCD approach to indentation. Otherwise all of the old problems come back, it's just that you've managed to isolate them to a per-developer basis, because the shared code is consistent.

      And if you think you can force everyone to use the same IDE, then I see you're a novice programmer.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    43. Re:Possible Explanation... by serviscope_minor · · Score: 1

      Yes, this! Why oh why is it so fucking hard to understand???

      --
      SJW n. One who posts facts.
    44. Re:Possible Explanation... by serviscope_minor · · Score: 1

      Basically it sounds like you're saying everyone should use the same indent as you because you can't be arsed to set up indentation properly.

      There's nothing "proper" about 8 spaces per tab.

      And why are you still catting code to a terminal in this day and age? Why not use a tool like vimcat which cats the code, but passing through vim so you get syntax highlighted code in your terminal along with a sane indentation scheme.

      --
      SJW n. One who posts facts.
    45. Re:Possible Explanation... by serviscope_minor · · Score: 1

      And the other person who's trying to use your file has to guess.

      Guess what? The thing is they *can't* guess how many spaces per tab I personally use, that's the beauty of it. One tab semantically means one indent level.

      --
      SJW n. One who posts facts.
    46. Re:Possible Explanation... by skids · · Score: 1

      WRT is glued together with bash scripts. Not my decision.

    47. Re:Possible Explanation... by ShanghaiBill · · Score: 1

      you're a heretic who will be first up against the wall when the revolution comes!

      No, you will just be paid less.

    48. Re:Possible Explanation... by erapert · · Score: 1

      Intelligent devs use IDEs that handle all this formatting nonsense for them

      And that's precisely the point of tabs in the first place!
      1 tab == 1 indentation!
      instead of futzing around and worrying about how many spaces to use.

    49. Re:Possible Explanation... by Junta · · Score: 1

      Actually, there is still the matter of what you *tell* the IDE to do.

      The popular opinion on each project wins. I did enjoy changing tabstop the other day for someone's code that had perhaps way too much nesting...

      --
      XML is like violence. If it doesn't solve the problem, use more.
    50. Re:Possible Explanation... by Cederic · · Score: 1

      So build the scripts off-platform and run them through a deployment utility that strips symbols down to a single character and removes all extraneous spaces and carriage returns.

    51. Re:Possible Explanation... by Gr8Apes · · Score: 1

      And that's precisely the point of tabs in the first place! 1 tab == 1 indentation! instead of futzing around and worrying about how many spaces to use.

      Just wait for it....wait for it....

      The next level of understanding is just around the corner.

      --
      The cesspool just got a check and balance.
    52. Re:Possible Explanation... by Gr8Apes · · Score: 1

      The popular opinion on each project wins.

      No, the consensus was that there wasn't a single best coding format that everyone could agree upon. Otherwise we would never have had the initial spaces vs tabs discussion, much less any of the other coding format holy wars.

      --
      The cesspool just got a check and balance.
    53. Re: Possible Explanation... by Gr8Apes · · Score: 1

      vim has code formatting capabilities far beyond merely subbing spaces for tabs. I'm sure Sublime Text does as well.

      --
      The cesspool just got a check and balance.
    54. Re:Possible Explanation... by networkBoy · · Score: 1

      BTW, as far as I'm concerned, any language that is whitespace dependent isn't really a candidate for a usable language. We'll throw that out there as well.

      +1

      --
      whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
    55. Re: Possible Explanation... by KGIII · · Score: 1

      Whitespace?!? Racist!

      --
      "So long and thanks for all the fish."
    56. Re:Possible Explanation... by gweihir · · Score: 1

      Ah, no? My editor does it for me, mostly. Maybe the lesson here is that competent developers use better editors?

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    57. Re:Possible Explanation... by Gr8Apes · · Score: 1

      Your IDE alone cannot incorporate that solution,

      Actually, they can. I use at least 3 different IDEs, they all can conform. If I choose to use an archaic IDE that cannot be made to conform, well...

      To make it work you really need a standalone tool that you can integrate with source control.

      To have a version control extension that validates and modifies code is cause for concern. Let's just say at the version control point is not where you want to muck with code. There's a whole lot more validation than mere code formatting I like done, and the build and test systems is where all of that should and does occur.

      You have a version control workflow that accepts changes into the various release branches, correct? We are living in the 21st century after all.

      And unless you force everyone to use the same IDE, you still need the spaces-only LCD approach to indentation.

      I'll be succinct: Spaces suck.

      And if you think you can force everyone to use the same IDE, then I see you're a novice programmer.

      Your trolling remarks are merely a sign of your inexperience. See above, I only require that IDE's are capable of properly formatting code. If you're still stuck using something from the notepad era, well, a world of wonder awaits you.

      --
      The cesspool just got a check and balance.
    58. Re:Possible Explanation... by Hognoxious · · Score: 1

      I do. I find it quite therapeutic. Though more often than not I just let the pretty printer do it.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    59. Re:Possible Explanation... by Darinbob · · Score: 1

      Except that it is only semantically one indent level to you. To other people the tab is used differently. There's no standard here. Using tab the way you described, if done universally, would resolve a lot of problems. However what actually happens is that people don't use them the same way and you end up with screwed up files with a mix of tabs and space and a mix of different tab stop settings. If you have to split a line (and you usually do because line length limits should apply) then you have to deal with aligning the broken parts of the line and you can't do that with just straight up indentation depending upon the coding style in use.

    60. Re:Possible Explanation... by BronsCon · · Score: 1

      Dude, he talks about "[dealing] with code for 30 to 40 years" but he just doesn't get it. I think we're both wasting our time.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    61. Re:Possible Explanation... by BronsCon · · Score: 1

      Except that it is only semantically one indent level to you. To other people the tab is used differently. There's no standard here.

      No, in truth there is a standard. You press the tab key once (or hit the spacebar X number of times, where X is your preferred indent width) to increase your indent level by 1. That's been the standard on every project I've ever touched; nobody indents by more than one tab at a time.

      Using tab the way you described, if done universally, would resolve a lot of problems.

      Indeed it would, which is why I advocate for the use of TAB for indents, and replace spaces as I find them.

      However what actually happens is that people don't use them the same way and you end up with screwed up files with a mix of tabs and space and a mix of different tab stop settings.

      In truth, that only happens when people indent with spaces. You get one guy who configures his editor to insert 2 spaces when he hits TAB, another who configures his editor for 4, and that oddball who just sues the spacebar and manually indents with 3, and now you've got 3 different standards in one file. If everyone just used fucking tabs, the guy who likes 2 would have 2, the guy who likes 4 would have 4, and the oddball could have his 3, with nobody having to engage in a pissing match over who is right or decide between enduring someone else's indent width or updating the file to match their own.

      If you have to split a line (and you usually do because line length limits should apply) then you have to deal with aligning the broken parts of the line and you can't do that with just straight up indentation depending upon the coding style in use.

      Right, you indent to the same level with tabs, then align with spaces. Of course, you have to use the same definition of "indent" and "align" as the rest of the industry to understand how that works.

      That code review you mentioned in the other thread, go grab that, I want you to try something. You said some lines were indented with 3 spaces, some with 4, and some with 8. Pick one of those values, any one, it doesn't matter, and replace all the tabs in that code with that number of spaces. Now open it in your code review tool and tell me, does that file look any better now that it's only indented with spaces? Or is the alignment still fucked up?

      If you really want to see the light, go through that same code and replace the spaces used for indentation with tabs, one for each level of indentation. Since the file has mixed indentation widths, you'll have to manually do this; 1 tab for every 3 spaces on lines indented with 3 spaces, 1 tab for every 4 on lines indented with 4 spaces, and 1 tab for every 8 spaces on lines indented with 8. Once that's done, look at it again in your code review tool.

      How does that suit you? It probably looks a lot more even and structured, right?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    62. Re:Possible Explanation... by Darinbob · · Score: 1

      You misunderstand, First, this is old code, still in use or still being viewed. Sometimes it is new files too of course. But there are tools that work different. One tab adds 4 spaces, two tabs is 8 spaces. So if the indentation is intended to be 8 spaces then the editor or tool adds 2 tabs. But if someone wants tab stop to be 2 spaces then the tool will stick in 4 tabs to get up to 8 spaces. This seems to be the most comon use that I see in older tools, it's the only way that explains why I see files where two lines in the same file that use only tabs but no spaces still don't line up like they should.

      Yes, it's dysfunctional. It exists though. People with experience have had to work with all sorts of dysfunction at some time or other.

    63. Re:Possible Explanation... by ben_kelley · · Score: 1

      vim you insensitive clod!

    64. Re:Possible Explanation... by serviscope_minor · · Score: 1

      If you have to split a line (and you usually do because line length limits should apply) then you have to deal with aligning the broken parts of the line and you can't do that with just straight up indentation depending upon the coding style in use.

      ???

      You split the line, indent it to the indentation level with tabs, the nspaces the rest of the way. That still works perfectly with changing the tab stops.

      --
      SJW n. One who posts facts.
    65. Re: Possible Explanation... by sirv · · Score: 1

      your salary ?

    66. Re: Possible Explanation... by BronsCon · · Score: 1

      What the hell kind of broken "tools" are you using? Just try what I said, you might be pleasantly surprised. Again, I fall squarely in the category of "people with experience", I have, in fact, encountered what you are talking about and I am trying to point out a solution. Hunor me and learn something, or keep arguing and remain ignorant, it's ultimately your ego's call, but you're never too old or experienced to learn a new trick.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    67. Re: Possible Explanation... by K.+S.+Kyosuke · · Score: 1

      Yes, the Intelligent Developer's Editors.

      --
      Ezekiel 23:20
    68. Re:Possible Explanation... by BronsCon · · Score: 1

      So... the right answer is spaces.

      Actually...

      So then I told my editor to reformat and replace all the tabs with appropriate numbers of spaces....

      The correct answer would have been to tell your editor to make tabs X spaces wide, where X is the number of spaces you wanted to indent by.

      It did mean that people couldn't easily use different indentation levels, but that's a small price to pay.

      And a price that would not have to have been paid had you properly understood the problem.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    69. Re:Possible Explanation... by BronsCon · · Score: 1

      I knew there was something I liked about you...

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    70. Re:Possible Explanation... by BronsCon · · Score: 1

      Otherwise we would never have had the initial spaces vs tabs discussion

      I still don't know why that discussion ever started in the first place. We use the TAB key to indent, why should that ever insert SPACES?! That's what the SPACE bar is for; TAB should insert tabs. End of story, amirite?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    71. Re:Possible Explanation... by BronsCon · · Score: 1

      YES! This is the one true way.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    72. Re:Possible Explanation... by BronsCon · · Score: 1

      No, because we're discussing professional developers. Using spaces won't help in that scenario, anyway.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    73. Re:Possible Explanation... by BronsCon · · Score: 1

      Which is also what happens when the code is cat'ed on a terminal, looked at in a diff program

      Your terminal doesn't honor the control code emitted by the tabs command? Sounds like you need to find a POSIX compliant terminal; then, your tabs can be whatever width you like.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    74. Re:Possible Explanation... by BronsCon · · Score: 1

      Precisely why I use tabs. I like 4 (or 2 depending on display dimensions as 4 can push heavily nested code off screen or off page), but some people like 3, 5, 6, 8, or whatever else. With tabs, whoever is looking at my code can decide how far it should be indented; and that includes me if I'm on my 6:4 display ratio Chromebook or printing to a portrait-orientation page.

      That way, nobody has to argue about indentation width as we can all choose what we like.

      The common argument against tabs is that someone inevitably slips a series of space-indented lines into the code and it no longer lines up if you change your tab width from whatever they were using when it happened. That's not an argument against tabs (which are consistent with the user's tab-width preference), though; it's an argument for replacing the erroneously-added spaces with tabs when you find them.

      Any good IDE or editor will actually tell you when there are mixed tabs and spaces in a file and offer to fix it for you, even, so it's not even any extra work.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    75. Re:Possible Explanation... by BronsCon · · Score: 1

      Working with spaces is nearly identical if you set up your editor correctly. If I hit tab, it inserts enough spaces to go to the next tabstop, which I have set to 4.

      And when I have mine set to 2? Do you not see a problem there? Let me explain.

      Your indents, then, all look too wide to me, and mine all look too narrow to you.

      If we used tabs, though, all of your indents would appear 2 spaces wide to me and all of mine would appear 4 spaces wide to you.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    76. Re:Possible Explanation... by BronsCon · · Score: 1

      Then you correct the mistake made by the person who used spaces. Problem solved.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    77. Re:Possible Explanation... by BronsCon · · Score: 1

      Bingo. I probably don't use the same editor as you and, even if I do, I probably don't want your settings.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    78. Re:Possible Explanation... by skids · · Score: 1

      Yes! And I could also eat my sandwich through a straw!

    79. Re:Possible Explanation... by aberglas · · Score: 1

      Nonsense.

      Tabs can mean one of two very different things. Namely indent to the 8th tab stop or indent one level (might be 2 or 4 chars). IDEs cannot reconcile them, nothing can.

      And Git (now the only SCCS) will scream if tabs and spaces are changed -- lots of noisy diffs.

      In theory an IDE could ignore leading white and just display what it thinks is correct, but not one of them does that in practice.

      Personally, I prefer my code to just be justified. None of this indenting nonsense. Illiterate programming.

    80. Re:Possible Explanation... by swillden · · Score: 1

      You must have missed where I pointed out the problem with your solution.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    81. Re:Possible Explanation... by BronsCon · · Score: 1

      No, I saw it, you're just wrong. If you understood the problem you were trying to solve, you would see that. The problem wasn't the tab characters in the files, it was that you had your editor set to treat them as 8 spaces rather than your preferred indent width.

      Instead of forcing a compromise on everyone else, use your tools properly.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    82. Re:Possible Explanation... by swillden · · Score: 1

      There contexts other than editors. Terminal windows, printers, etc. Adjusting tab sizes everywhere that may be relevant, across multiple systems, is just silly.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    83. Re:Possible Explanation... by BronsCon · · Score: 1

      You very well may want different indent depths for different mediums, sometimes even depending on the aspect ratio of the output. For example, I prefer 2 spaces on my 6:4 Chromebook and my portrait (9:16) 4k display, or when printing to an 8.5x11" page, because there's relatively less horizontal space compared to other output formats. This keeps heavily-indented lines from wrapping or getting cut off.

      On the other hand, I prefer 4 when displaying on a 16:9 or 22:9 display, or when printing at 11x8.5", because there's plenty of horizontal space and it looks nicer to fill it out more. I used to prefer 8 spaces on my 22:9 display, and I know many people who still do.

      TL;DR: In contexts other than editors, you may want a different indent depth anyway.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    84. Re:Possible Explanation... by HornWumpus · · Score: 1

      A self loading, sandwich firing gatling straw! Compressed air powered, across the room. Without breaking your 'stream of code' to eat.

      There is no better use of your boss's time. It will do wonders for your efficiency.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    85. Re: Possible Explanation... by Reverend+Green · · Score: 1

      DoesHound watch your commits? It will complain vigorously if you mix spaces and tabs in Python.

    86. Re:Possible Explanation... by PoopJuggler · · Score: 1

      No, I think you demonstrated it, but in the wrong direction. Good source code formatting improves readability and maintenance, which improves quality and productivity, which leads to a better product, which leads to better salaries.

    87. Re:Possible Explanation... by swillden · · Score: 1

      TL;DR: In contexts other than editors, you may want a different indent depth anyway.

      I don't.

      Plus, I make more money than you :P

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    88. Re:Possible Explanation... by BronsCon · · Score: 1

      I don't.

      I meant he collective "you". Someone might; in fact, someone does. Drop the ego and stop imposing your preferences on others.

      Plus, I make more money than you :P

      Is that before or after I cut payroll checks? Put another way, I highly doubt that.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    89. Re:Possible Explanation... by Marxist+Hacker+42 · · Score: 1

      90s? Try 70s. Which is why it is so insane that python wants to be thought of as a modern programming language.

      --
      SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
    90. Re:Possible Explanation... by lsatenstein · · Score: 1

      I just use a formatter that converts tabs to spaces. Make python programmers happy

      And it can also go the other way too.

       

      --
      Leslie Satenstein Montreal Quebec Canada
    91. Re:Possible Explanation... by Gr8Apes · · Score: 1

      But the population of folks working with the codebase back then, and the processes around it were such that there weren't really holy wars of people converting code style formats wholesale back and forth across large teams. At least not in my experience. It really came to a head in the 90s when higher level languages became accessible to enough novice "programmers" with no training entered the professional workforce with all their odd and esoteric manner of formatting code. Some were better, many were not. (I still recall the 3 space indent guy, what an annoying jerk:)

      --
      The cesspool just got a check and balance.
    92. Re:Possible Explanation... by Gr8Apes · · Score: 1

      Git is great. It still has shortcomings, and certainly isn't really intelligent about source code. (Here come the flames, I'll duck and don my hi-temp suit)

      And my point implicitly stated is that white space is irrelevant except as a demarcation. I stated this explicitly elsewhere in this thread. What makes code pretty to view is unnecessary to the codebase. Therefore, much like test specific code, such "view formatting code" shouldn't be in your codebase either. IDEs should just display the code the way you have it set up, the final compiled code doesn't care if you used 1, 2, or 3 spaces or tabs, so why have extras? JS minification is a practical case in point regarding whitespace.

      --
      The cesspool just got a check and balance.
    93. Re:Possible Explanation... by Gr8Apes · · Score: 1

      shucks... ;)

      --
      The cesspool just got a check and balance.
    94. Re:Possible Explanation... by Gr8Apes · · Score: 1

      Otherwise we would never have had the initial spaces vs tabs discussion

      I still don't know why that discussion ever started in the first place. We use the TAB key to indent, why should that ever insert SPACES?! That's what the SPACE bar is for; TAB should insert tabs. End of story, amirite?

      It's because way way way back, "editors" weren't able to vary the tab into anything other than 8 space representations. Thus, a group of people stuck on 80 column monitors would indent twice and holy crap, 16 characters per line were gone. Add that to that idiotic Hungarian notation that added up to 10 prefix characters to your variables, and wow, you would take over 305 lines to write

      for(int i = 0; i < z.length; i++) { z[i] = z[i] < y ? x+y : y;};

      --
      The cesspool just got a check and balance.
    95. Re:Possible Explanation... by BronsCon · · Score: 1

      I do recall starting on a system that was... huh, was it 50 or 60 columns? Now I don't remember.

      I did use spaces back then; one per indent. Thankfully, we no longer live in that world; why do some people insist on remaining stuck there?

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    96. Re:Possible Explanation... by Gr8Apes · · Score: 1

      It's to ensure the old adage, badly paraphrased as "Progress is made by the old dying off and being replaced by the new" remains true.

      --
      The cesspool just got a check and balance.
    97. Re:Possible Explanation... by shutdown+-p+now · · Score: 1

      Visual Studio, and Eclipse (at least) all use tabs by default.

      For Visual Studio, at least, this doesn't make sense, because it doesn't have a single global default - it varies per language. It does use tabs by default for C and C++, but it uses spaces by default for C#, VB, Python, and most everything else.

    98. Re:Possible Explanation... by michael_wojcik · · Score: 1

      My church recommends starting an open-source project together before even getting engaged, you learn so much about a person just settling on which license to use.

      Reasonable. What's their position on premarital pair programming?

  35. Re:I use spaces but indent by 2 spaces rather than by __aaclcg7560 · · Score: 1

    No idea what I'm doing wrong, if it isn't the spaces!

    If you grew up on typewriters, two spaces between sentences was the norm. A habit I had to break when I transitioned from typewriters to word processors years ago. The only time I see two spaces between sentences these days is in comments for Python code.

  36. Re:I use spaces but indent by 2 spaces rather than by Anonymous Coward · · Score: 1

    If you're using two spaces, you probably work at Google. Do they dock your pay for using extra spaces?

    Yeah, you work at Google. Or you use any of the common languages / frameworks (Javascript, Rails, for example) who generally use 2 spaces. Or you just care about information density, since IDEs make code block folding completely fucking trivial, so there's very little need to create a strong visual offset with 4 spaces and waste screen space & file size by putting in unnecessary white space.

    They don't dock our pay for using extra spaces, they dock our pay for doing stupid shit - something I'm sure you're quite familiar with, creimer.

  37. Re:I use spaces but indent by 2 spaces rather than by omnichad · · Score: 1

    Word at least used to automatically convert end of sentence to two spaces anyway - maybe they've changed. I still use two spaces at the end of a sentence because it's easier to parse.

  38. Re:I use spaces but indent by 2 spaces rather than by mspohr · · Score: 1

    The perfect number of spaces is 3.
    Two is not enough to clearly see indents.
    Four is just a waste of space.

    --
    I don't read your sig. Why are you reading mine?
  39. Emacs untabify by hedley · · Score: 1

    Done. Where's my money?

  40. Soooo... I should switch to spaces... by QuietLagoon · · Score: 1

    ... and ask for the 20% salary increase?

  41. Re:$59,140 and $43,750 are the medians? by 93+Escort+Wagon · · Score: 2

    Yeah, this is heavily weighted towards S/SE Asia - and the fact that spaces versus tabs actually matters to them may say something.

    --
    #DeleteChrome
  42. Re:I use spaces but indent by 2 spaces rather than by Rockoon · · Score: 1

    Google learned it by watching professions.

    --
    "His name was James Damore."
  43. Re:I use spaces but indent by 2 spaces rather than by __aaclcg7560 · · Score: 1

    Word at least used to automatically convert end of sentence to two spaces anyway - maybe they've changed.

    Unless you're using a monospaced font, all fonts provide a little extra space between sentences without adding an extra space character.

  44. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  45. Some developers are paid by p4nther2004 · · Score: 1

    by the keystroke, apparently.

  46. Re:I use spaces but indent by 2 spaces rather than by __aaclcg7560 · · Score: 1

    Yeah, you work at Google.

    I heard about the two space indentation from a YouTube video that Google developers gave on Python. Or maybe Guido van Rossum joked about it in one of his videos on YouTube.

  47. There are a few easy explainations for this ... by Qbertino · · Score: 1

    1.) Space-indent is almost universially used by old-school C coders and other compiled languages, because they use ancient CLI editors that don't tab by default and care squat about sourcefile size and bandwidth usage (as webdevs do), because they always compile. Those types are more rare but get more money for their work. Specialists.

    2.) Space has come to dominate the indent-wars, which means a passionate tabber is more likely to be percieved as a stubborn non-team player and hence get lesser pay or be at low paying jobs where he/she is the sole programmer in a smaller shop that pays less.

    3.) Because space dominates the official indent rule space, there are more automated tools enforcing space-indent which in turn means tabbers only are able to tab in smaller non-CI environments, which in turn means they are again more common in mixed shops.

    4.) Tabbers are most commonly found in the web development community, where tab-indent means way less data travelling through the intertubes. Web coders earn less.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:There are a few easy explainations for this ... by phantomfive · · Score: 1

      where tab-indent means way less data travelling through the intertubes

      Once it gets through compression the difference is negligible. Once it gets through a minimizer, the difference is non-existent.

      --
      "First they came for the slanderers and i said nothing."
  48. Hmm by Ryanrule · · Score: 1

    This seem an age thing, right?

  49. They neglected to control for editors by Trevin · · Score: 1

    The type of text editor you use — Eclipse, Emacs, Nano, Notepad, vi, or some other IDE or stand-alone editor — can have a large influence on whether your code is intended with tabs or spaces, as most code editors have their own defaults for indentation. I would speculate that the type of IDE or editor a programmer uses has a higher correlation to salary than just tabs vs. spaces.

  50. Re: Yeah but by ranton · · Score: 2

    Considering the average developer salaries were around $50k, they can't be that great. Who is even paying junior developers that little? I can't get a competent developer for under six figures even in the Midwest suburbs.

    --
    -- All that is necessary for the triumph of evil is that good men do nothing. -- Edmund Burke
  51. Re:Only LUDDITES use tabs or spaces! by tepples · · Score: 1

    What's this supposed to mean? That the editor inside an app for making apps ought to store an app's logic as a syntax tree rather than as textual source code, with indentation calculated at runtime based on nesting in the tree?

  52. I'm not surprised by nospam007 · · Score: 1

    "Developers Who Use Spaces Make More Money Than Those Who Use Tabs"

    Small wonder. Just like in Microsoft Word, managers and executives have no clue on how to use tabs and uses spaces instead.

  53. Article is garbage. by GungaDan · · Score: 1

    It doesn't even say whether female developers use tabs or spaces more often. This important contributing factor to the gender pay gap must be investigated and corrected!

    --
    Eloi are stupid, throw morlocks at them!
  54. Re:I use spaces but indent by 2 spaces rather than by omnichad · · Score: 2

    I'm pretty sure that the actual space (ASCII character 32) is rendered the same width regardless of its placement, even on proportional fonts. Individual characters stand alone in size and rendering, except when ligatures are involved. Some programs will insert a different kind of white space character - like an em or en space, or a second space after a period - but a font does not have anything different to offer when rendering a space between sentences. All you have to do is look at your own original comment to see that the space is the same size.

    In Slashdot comments, my double-spacing is rendered in HTML as a single space because HTML only renders one space in a consecutive string of white space. However, I developed that habit out of visual preference - I started typing well after the typewriter era.

  55. On Tabs and Spaces by Qbertino · · Score: 2

    It's tabs. Here's why:

    1.) Tabs are characters specifically meant for indentation - that is the only reason this character exists.

    2.) They use up way less bandwidth. I once cut down an HTML document from my space fanatic buddy from 80kb to 36kb just by converting from spaces to tabs. When 50+% of your bandwidth is used up by whitespace, you're a shit coder. True thing. ... Use spaces on my product and I'll woop your ass.

    3.) With tabs everyone can decide on his own how far the indent is. That's how it's meant to be. That's the whole point of the indent character called "tab".

    That said, I've given up on trying to explain the above to space junkies - they really don't seem to get it.
    Today I usually avoid this discussion and settle for whatever the official standard is for a given programming language and use buildtools that clean up the code form excess whitespace before deployment on the web. For JavaScript that's space-indent with two spaces - really shitty, but I guess they're trying to suck it up to the C-snob crowd, so who am I to think I could stop them. The advantage in going with whatever is the standard for a given PL is that you can use the standard linters and commit hooks as they come and easyly set up your CI and build environment in such a way that it enforces uniformity. If that means only commiting two-space indents, I'll bite the bullet. Especially if I'm the lead and/or responsible for the dev-pipeline.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:On Tabs and Spaces by trg83 · · Score: 1

      Very little whitespace, including line breaks, needs to exist in web code meant to be consumed by another machine on the other end. If you are sending the original code typed by a developer over the web, you are doing it wrong. At a minimum, you would want to make sure your web server correctly supports compression, but generally you would want to pre-optimize your web content during your build process. The bandwidth argument is nonsensical and irrelevant to the tabs vs spaces argument.

      This is not in any way meant to pick on you or your preference: I see many benefits of a properly-orchestrated tab coding convention. I just don't think anyone should make the decision based on flawed reasoning.

    2. Re:On Tabs and Spaces by chefmonkey · · Score: 2

      2.) They use up way less bandwidth. I once cut down an HTML document from my space fanatic buddy from 80kb to 36kb just by converting from spaces to tabs. When 50+% of your bandwidth is used up by whitespace, you're a shit coder.

      The '90's just called and they want their webservers back.

      With a data point of one, it appears that people who use tabs might not understand the technology they're using. This may have explanatory power.

    3. Re:On Tabs and Spaces by Tony+Isaac · · Score: 1

      My biggest problem with tabs is that GitHub and other source code repositories do a terrible job of formatting tabs. If you use spaces, the formatting comes out consistently every time.

    4. Re:On Tabs and Spaces by naris · · Score: 1

      Wrong! The only sane choice are spaces! Tabs are a hugely bad idea! Only a true moron would advocate using tabs over spaces. A space is ALWAYS 1 character that uses 1 column. Tabs are sometimes 8 columns (which is the default value inherited form typewrites that toy see in notepad and other dumb editors), sometimes 4, sometimes 2, sometimes 3 depending on how each individual sets their editor (providing they use an editor that has settings. Anything using tabs that is worked on by more than 1 person, especially if vendors, outsourcing and.or offshoring happens, will repidly devole into a randomly indented mess that is impossible to determine where code blocks even are and are impossible to format correctly! As for concerns about bandwidth and space, that is complete rubbish! The 1970's want their 300 baud modem and floppy disks back!

  56. Re:I use spaces but indent by 2 spaces rather than by __aaclcg7560 · · Score: 1

    All you have to do is look at your own original comment to see that the space is the same size.

    Slashdot isn't a word processor that uses proportional fonts. Of course, the space is the same.

  57. Great! by in10se · · Score: 1

    Another non-scientific poll/survey on the internet that means nothing, but is posted to cause a comment flame war. SPACES! TABS! GREAT TASTE! LESS FILLING!

    --
    Popisms.com - Connecting pop culture
  58. What about developers who mix tabs and spaces? by Monkier · · Score: 1

    Their salary should be zero.

  59. Definitely must mean that if you use spaces... by x_t0ken_407 · · Score: 1

    ...you'll make more money, right? That's how these things work right?

  60. Re:I use spaces but indent by 2 spaces rather than by omnichad · · Score: 1

    My comment is displaying in Arial - a proportional font. The font operates the same whether it's a word processor or not. If a word processor is displaying it differently, it's also not just a space character being displayed and the file won't contain just a space character either.

  61. Is it just me? by CustomSolvers2 · · Score: 1

    Or GitHub is too picky with the tab/spaces differences? I tend to use tabs (not something I really care about, but... I wish the worst to the Hooli-loving space heretics! LOL), but also in languages not caring about spaces/tabs (every language other than Python?) and IDEs which theoretically should take care of these issues automatically.

    For example, when writing C# in Visual Studio, I don't even need to use tab/spaces (write a line of code, with 1-space separations between words, press enter and VS automatically sets the left indentation of the next line). If I want to change the default indentation, I use tabs. Same thing with other IDEs I use like NetBeans, Eclipse or Code::Blocks; I also use Notepad++ quite a lot and it seems to perform quite well on this front (it might not even provoke the problem which I am referring right now). But here comes the tricky part: when I upload a code created with one of these IDEs to GitHub, I usually get some files with random lines being wrongly indented, even though they look fine in the IDE. I think that this is provoked by the times when I paste in the given IDE code which I have written with a different program.

    This isn't precisely a big deal, but kind of curious. Why is GitHub not getting what IDEs/editors get and even what the naked eye gets (if you edit one of these files in GitHub directly, let it looking fine and save it, the wrong-indentation might still be there; you have to remove all the lines not fully synchronised with the expected tabs/spaces)? Or even more important: why caring so much about spaces/tabs in programming languages pretty much ignoring that aspect and compiling fine regardless of this issue?

    --
    Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
  62. Developers who kiss more ass make more money by zifn4b · · Score: 1

    Or I'm sure there are studies to show the correlation between ass kissing and promotions are ubiquitous across all fields. A corollary from this would be: It's not how well you do your job that matters, it's how well you kiss ass. Ego-stroking will get you everywhere. And that we also see in Silicon Valley as well.

    --
    We'll make great pets
  63. Re: I use spaces but indent by 2 spaces rather th by Anonymous Coward · · Score: 2, Funny

    Three spaces? That's ... odd.

  64. The true master uses 3 spaces rather than 2 or 4. by presidenteloco · · Score: 1

    2 can be hard for some people to eye the alignment accurately, and with 4 you run out of line length too often, unless you extend your program line arbitrarily like a moron.

    Also it is harder for the tab mafia to convert your 3-spaced code into tab graffiti.

    3 spaces - the choice of champions.

    --

    Where are we going and why are we in a handbasket?
  65. HyperTalk by tepples · · Score: 1

    I first learned 2s space because it was the standard for HyperTalk, the scripting language of Apple's HyperCard, and enforced by HyperCard's script editor. HyperTalk predated the World Wide Web, let along Google.

  66. Less than half reported their salary by Perl-Pusher · · Score: 1

    And many get paid less than plumbers. Really that is a pretty low salary, you would think they were H1B visa holders.

  67. Re:I use spaces but indent by 2 spaces rather than by mpercy · · Score: 1

    More explanation than one may want...

    https://en.wikipedia.org/wiki/...

    A related topic is kerning, which means that characters are *not* rendered the same in all cases. "kerning is the process of adjusting the spacing between characters in a proportional font, usually to achieve a visually pleasing result. Kerning adjusts the space between individual letter forms, while tracking (letter-spacing) adjusts spacing uniformly over a range of characters.[1] In a well-kerned font, the two-dimensional blank spaces between each pair of characters all have a visually similar area."

    "The CSS property text-rendering: optimizeLegibility; enables kerning in Firefox, Chrome, Safari,[11] Opera, and the Android Browser.[12] There is also a proposed CSS3 property font-kerning,[13] but it is only supported in Firefox (prefixed with -moz-), Chrome and Opera (prefixed with -webkit- in both) and in Internet Explorer starting at version 10.[14] The CSS3 draft suggests that kerning should always be enabled for OpenType fonts."

  68. Makes perfect sense. by Anonymous Coward · · Score: 1

    Nice guys always get paid less than rude assholes.

    Forcing your indenting preferences on others (by using spaces) is a hallmark of a rude asshole.

  69. editor question by cellocgw · · Score: 1

    I understand that lots of editors automagically convert the TAB key into four spaces. That's cute and all, but do any editors have the ability to "remember" that you hit TAB there so if you go back to delete the space, it'll delete all 4 space chars?

    I know from experience that none of the standard cheapo editors do, nor does, say, MATLAB's editor.

    There, then, is one excellent reason to use actual real TAB characters: the ability to delete them when you want to.

    --
    https://app.box.com/WitthoftResume Code: https://github.com/cellocgw
  70. LOL, I use em dashes! by WillAffleckUW · · Score: 1

    That's why I get the big money!

    --
    -- Tigger warning: This post may contain tiggers! --
  71. Re:I use spaces but indent by 2 spaces rather than by __aaclcg7560 · · Score: 1

    And if a Google developer mentions it, then that automatically means that ONLY Googlers do it, and it was invented at Google?

    That only works with Apple.

  72. Re:I use spaces but indent by 2 spaces rather than by amicusNYCL · · Score: 1

    This is fake news. If you can't see indents with 2 spaces, another space isn't the solution to your problem. 3 is right out.

    --
    "Our two-party system is like a bowl of shit looking at itself in a mirror." - Lewis Black
  73. Makefile by tepples · · Score: 1

    Makefiles use both. The Make standard requires that commands in recipes be indented with one tab. Everything indented that's not a command in a recipe, such as long lists of prerequisites for a target using a backslash for line continuation, uses spaces to keep them visually distinct from the recipe.

  74. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  75. Space matters little in minified script by tepples · · Score: 1

    Tabbers are most commonly found in the web development community, where tab-indent means way less data travelling through the intertubes.

    Why? A JavaScript interpreter uses braces rather than leading spaces to identify blocks. Line-initial space and most other whitespace gets removed anyway when the build process minifies JavaScript source into the form sent over the wire.

  76. Re:Only LUDDITES use tabs or spaces! by CaptainDork · · Score: 1

    LUDDITES don't use any equipment that has tabs or spaces ... or APPS.

    --
    It little behooves the best of us to comment on the rest of us.
  77. Correlation by PortHaven · · Score: 1

    Correlation != Causation
    Correlation Causation
    Correlation NE Causation
    Correlation NOT EQUAL Causation

    Perhaps, the language and/or common IDE tools for a given language makes a determination as to whether tabs or spaces are used. In particular, something as simple as the default font used could make a difference in visual appeal. As such, what this likely determined is that a higher paying programming language's common IDE is likely more favorable visually toward spaces.

  78. Re:I use spaces but indent by 2 spaces rather than by omnichad · · Score: 1

    All of that says that most digital editors currently don't add a second space between sentences.

    I know all about kerning - but that's between letters within the word. Nothing to do with spacing sentences.

  79. Or, you now.... by rochrist · · Score: 1

    Developers who make more money prefer to use spaces over tabs.

  80. Re:The true master uses 3 spaces rather than 2 or by religionofpeas · · Score: 1

    with 4 you run out of line length too often, unless you extend your program line arbitrarily like a moron.

    Or you need to refactor your code better. Linux has no problems with 8-space tabs.

  81. Consistency... by pogopop77 · · Score: 1

    Spaces are always one character, tabs can be interpreted differently on different platforms/editors, etc. I use spaces, so I know exactly what the code will look like in any monospaced font. M-x untabify and C-M-\ fix non-compliant code nicely in emacs. Interesting correlation with salary, but I don't think there's any specific causation.

  82. I'd also want more money for spaces by johannesg · · Score: 1

    I'd also ask for more money if my boss insisted on spaces. Like I have nothing better to do all day long than correcting code that starts in columns that are not multiples of 4...

  83. I use an auto indenter by choupette · · Score: 1

    that happens to use spaces.

    --
    -- moo
  84. Re: I use spaces but indent by 2 spaces rather tha by lgw · · Score: 1

    I worked with a person who used three spaces. He's "not with us" anymore. :)

    I use 3 spaces for personal stuff. 2 is just not enough visual cue for me. But I don't inflict that on others.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  85. Re:I use spaces but indent by 2 spaces rather than by lgw · · Score: 1

    I know for a fact the two very big ones use WebKit's style guide as a basis for most of their work, and that it asks you to use spaces.

    "Two" big ones? The large employers are the "Big 5": Amazon, Apple, Facebook, Google, Microsoft.

    What's a "WebKit"?

    --
    Socialism: a lie told by totalitarians and believed by fools.
  86. Re:I use spaces but indent by 2 spaces rather than by lgw · · Score: 1

    Five!

    Three, sir.

    I also can't work with 2 spaces - just not enough visual cue.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  87. Never mind developers, what about managers? by AxeTheMax · · Score: 1

    Top managers who use spaces because they never understood tabs (because tab's are something that only typists use), they make more money than anyone else despite being quite unable to format a simple document.

  88. Re:I use spaces but indent by 2 spaces rather than by sexconker · · Score: 1

    Why would anyone use 4 spaces?
    If you're using spaces, you use 2. If you want more whitespace than 2 spaces, you're a tabs man, not a spaces man.

  89. Re: Yeah but by slew · · Score: 1

    Considering the average developer salaries were around $50k, they can't be that great. Who is even paying junior developers that little? I can't get a competent developer for under six figures even in the Midwest suburbs.

    Maybe that's because you aren't a body shop hiring H1bs bringing down the average... (as he ducks)

  90. Re:$59,140 and $43,750 are the medians? by lgw · · Score: 1

    Damn, that's starting wages for someone right out of school! Maybe I should stop using tabs AND spaces.

    The Big 5 pay close to 6 figures now right out of college. But the numbers in TFA are a global average.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  91. Re: I use spaces but indent by 2 spaces rather tha by mspohr · · Score: 1

    Probably left to get a better job where they appreciate the vast superiority of 3 spaces.

    --
    I don't read your sig. Why are you reading mine?
  92. Re:I use spaces but indent by 2 spaces rather than by mspohr · · Score: 1

    Try using more spaces.

    --
    I don't read your sig. Why are you reading mine?
  93. Re:Yeah but by Darinbob · · Score: 1

    This is very true. And these users get confused when the issue is brought up. I see this trend more common with solitary programmers, or those who use programming as just a side tool for their real job. Once you start sharing code though, putting it into a repository, having others try to use it, then you need to be a bit more formal about how the programs look.

    You can't really stick in the IDE for life. There are so many external tools that are needed that you're bound to run across issues with tabs.

  94. Stack overflow is not... by Martin+S. · · Score: 1

    Stack overflow is not really a bastion of elite developers

    It's demographic is a reflection of its purpose.

  95. Correlation vs. causation? by arobatino · · Score: 1

    More talented coders might write elaborate routines with more levels of indentation. With tabs, the inner level lines would wrap around more and make it harder to read.

  96. Slap him so hard ... by BenBoy · · Score: 1

    I slapped him so hard, his tabs expanded ...

  97. I suspect reverse causation by Dixie_Flatline · · Score: 1

    The correlation here is backwards.

    Programmers that make more money tend to use spaces.

    Why? Because programmers that make more money probably work for bigger companies. Bigger companies have coding standards. I've yet to meet someone that works for an organisation of any size that has a coding standard that enforces tabs over spaces.

    Now, why do companies use spaces over tabs? I'm not sure about that.

    1. Re:I suspect reverse causation by locofungus · · Score: 1

      Now, why do companies use spaces over tabs? I'm not sure about that.

      Because it's almost impossible to enforce consistent tab indenting. Apart from anything else you'll get passive-aggressive coders who will have a single tab at the start of every line and then use spaces.

      So even if space's weren't the right choice, it wins politically as you can enforce a "no tabs" policy. (Makefiles excepted)

      --
      God said, "div D = rho, div B = 0, curl E = -@B/@t, curl H = J + @D/@t," and there was light.
  98. Re:Yeah but by networkBoy · · Score: 1

    at my new gig I have started writing some software and I asked one of the other devs for a style guide...

    "use whatever" /twitch

    soCamelCaseItIs{
        with(the brackets done as such);
    }

    --
    whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  99. Eh, yes, both. by Ecuador · · Score: 1

    Tabs are for indentation. Everyone can choose how to display them, either as 2, 4, 8 (?!) spaces wide, by setting up their editor appropriately, and yet they all commit the same thing, one tab for each level, so there is no whitespace modification ever. Also, even people who use spaces in practice press the tab button. And the tab button produces spaces. Not OCD friendly.
    At the same time, ALIGNING things requires spaces. You align things (e.g. operators) that are at the same indent level (denoted with tabs) and everyone sees them the same, just at a different distance from the start of the line depending on their tab setting.
    At my previous job I had written the style manual, so we went with that. In my current work, it is all spaces and I don't really mind, as at least we use the same width that I'd use to render tabs, so everything looks nice. HOWEVER, it is not very rare for people to re-install, update etc their editor, continue hitting tab without realizing they had lost the spaces configuration, and their first commit changes all the whitespace...

    --
    Violence is the last refuge of the incompetent. Polar Scope Align for iOS
  100. Re:Yeah but by Darinbob · · Score: 1

    OMG, I've seen that code!

  101. Support for raise by VikingNation · · Score: 1

    Will my employeer give me a raise for switching from tabs to spaces.

  102. Re: I use spaces but indent by 2 spaces rather t by KGIII · · Score: 1

    True, but it is also rational.

    --
    "So long and thanks for all the fish."
  103. Re:What about IF brackets on the next line? by mike2006 · · Score: 1

    I second that. I put it on the next line but always feel I am an outlier doing so. I do it because for me it is much easier to read the code that way and it is cleaner.

  104. Spaces always work, tabs sometimes work. by sl149q · · Score: 1

    If you use spaces to indent your source code will look the same for everyone and will look the way you intended. Spaces always work and always work in the same way. If you don't like counting, use an editor that uses the tab key to insert the proper number of spaces for the indentation. But counting always works if you can't figure that out.

    If you use tabs to indent you have to rely on people correctly setting the tab width to match what you are using. And if they don't know how to do that and it is set up wrong, their impression of your code is that you are a twit and don't know how to consistently format your code. This is especially a problem with PHB that may be have little technical knowledge and decide to have a look at something. First impression is that your code looks unorganized.

    People shouldn't be reformatting your code to match their expectation of indentation unless they are taking over the project. Use the same indentation (and tabs set to the correct tabwidth if that is what the original author used.)

  105. Re:I use spaces but indent by 2 spaces rather than by beelsebob · · Score: 1

    The two big ones of those fave though, are Apple and Google these days.

    A WebKit... well... if you don't know what that is, you may need to learn a bit more about the tech industry.

  106. When Silicon valley (tv) lost its credibility by Smid · · Score: 1

    There's that moment in TV Shows where they get the tech wrong and all the believability just disappears.

    24 used to walk the fine line with this, but seemed to use basic gobbledegook interspersed with tech words so there wasn't a meaning...

    Mr Robot shot it completely when its executive walked up to the main star and complimented him on the use of Gnome as a desktop. Gnome??? Versus what? KDE? If it was cinnamon, mate or Xfce, yeah, but "oh look you use one of the most popular desktops on linux"!

    Silicon Valleys tech has always been a bit wobbly, though can be forgiven for making it funny. The tabs versus spaces thing just shot it to bits.

    You use an editor which converts your tabs to spaces, auto indents and allows mass selection and auto formatting according to languages. Whoever fed the writers that needs to enter the 90s. It's not even a putty vs mobaxterm (which is no battle at all, mobaxterm).

  107. Idiots will now switch to spaces by Theovon · · Score: 1

    What we have here is a bunch of average coders who have nothing better to do than take surveys, and we find that among them there is a correlation between the use of spaces and a *slight* boost in salary.

    What about the rock stars? What do they do? And what about the people who don’t consider themselves “programmers” who can code rings around those survey-takers? I know electrical engineers whose code looks like shit to me but beats the hell out of most of the stuff I see on github. Some use tabs, some use spaces. Who cares! These people make a minimum of $150K/year, putting them outside of the range of this sample.

    In my history of doing software engineering and digital circuit design, I have used tabs, spaces, and combos. After a while, I gravitated to using spaces in order to ensure that the code formatting would not change for different people. But what I actually use varies with the language.

    In C and C++, I use four spaces to indent. In Ruby, my two editors (vim and TextMate) do not have the same settings, so some code is indented 2, some 4. For Python, I use Jupyter, which I *think* defaults to 4 spaces, but I’m not totally sure, but I don’t care because I hate Python and only use it for sympy. For Java, I mostly use Netbeans, which I *think* uses 4 spaces. My Verilog code looks like a C programmer wrote it, because I can’t stand to put “begin" on separate lines, so I end up with things like “end else begin”, and I use four spaces to indent instead of the usual 2; I’m a maveric. I can read VHDL just fine, but I avoid writing it as much as I can. Assembly generally isn’t structured, so its indenting is really unimportant. I haven’t programmed Fortran since the days when you had to start in column 7. My Javascript code is indented like my C code; same with PHP. I can code in other languages too most of them require very little reading to get competent with the basic syntax, but the libraries can take a while to really master, so instead of investing time into “learning” them, I just google what I need as I go along.

    My favorite code-oriented job, however, is “expert witness.” There, I get to pick apart other people’s code and show how it does and does not match patent claims. I don’t have to write a single line of code, and I make $250/hour or more. The free trips to Washington, DC are nice too. Of course, this is no cake walk either. It takes a lot of concentration and energy to interpret patents and make sense of mazes of horribly structured code, which is why it pays that well. I keep getting called because I’m an expert in both graphics and digital circuit design, so the lawfirms always get a bargain.

  108. Re:1999 called... by naris · · Score: 1

    Micro optimizations were recognized as bad ideas in 1999 other than perhaps, for real time that ran often in limited environments such as micro-controllers and should of been coded in assembly or high performance applications such as games that were stretching the envelope of technology of the time. So really, it's the 1960s that called....

  109. Re:I use spaces but indent by 2 spaces rather than by lgw · · Score: 1

    Not sure why you'd think they're the biggest - they're all quite large (well, Facebook is the smallest). It's hard to get a count of total engineers in these companies, but Microsoft, may still be the biggest employer of devs - over 100K for sure. Amazon will be there soon if they aren't already - at the rate they're growing they'll be the largest employer of devs by far in about 2 years (they're current building 1 skyscraper a year in Seattle).

    Apple is the odd man out for not being "the cloud" as the other 4 are. The other 4 have fairly heavy interchange of devs between them now that the illegal recruiting agreements are gone.

    Judging by UIDs I've been doing this a bit longer then you kids on my lawn. But I write real code, not some silly "web" fad stuff that will be replaced by APPS (or so Slashdot informs me).

    --
    Socialism: a lie told by totalitarians and believed by fools.
  110. I press [Tab] to insert two spaces and... by Slashdot+Junky · · Score: 1

    I press [Tab] to indent for convenience. I configure editors to insert two spaces for each press of the [Tab] key and convert all existing TABs to spaces upon saving. I prefer spaces and like the indention increment set to two.

    --
    .
    Landfill Mining Co.
    Managing the (Un)natural Resources of Tomorrow
  111. Cause or Effect by herbierobinson · · Score: 1

    Most professional coders will use whatever conventions are already in use in the code they are working on. Programmers who re-indent and/or re-tab source code in a professional environment tend to get reprimanded for wasting time and messing up the merges.

    So, this is really more of a correlation with what types of projects pay better than whether spaces or tabs are used.

    --
    An engineer who ran for Congress. http://herbrobinson.us
  112. GoLang by snadrus · · Score: 1

    I use neither. When I hit save, it auto-reformats. I'm not sure really which it becomes.
    Checking...
    Tabs. Oh well, it's not me writing them.

    --
    Science & open-source build trust from peer review. Learn systems you can trust.
  113. SO WHAT!!! by martinfb · · Score: 1

    Wish I did not waste my time reading this silliness!
    I seriously doubt any correlation between salary and whether one uses spaces or tabs to indent!

    For what it is worth, I have my editor pad with spaces when I hit tab.
    That way, I can indent with spaces, yet use the tab key.

    Can I now get a raise in salary?!

    --


    Self-importance and self-indulgence is the root of ALL evil.