back to article Software dev bombshell: Programmers who use spaces earn MORE than those who use tabs

Weighing in on a longstanding religious war among software developers, community site Stack Overflow has found that developers who use spaces to indent their code earn more than those who use tabs. After crunching the data from its 2017 Developer Survey (released in March), Stack Overflow data scientist David Robinson on …

  1. frank ly Silver badge

    A question

    Is this because of the language used and its standard source code methodology?

    1. John Lilburne Silver badge

      Re: A question

      No its because places that have enforce coding layout styles generally pay more than places where everyone can write their shit any which way they want.

      HINT: Your editor should allow you to type TAB and have it replaced by the standard number of space (2,3,4, or 69) as appropriate to the layout style.

      1. ElReg!comments!Pierre Silver badge

        Re: A question

        All my vims are set to replace tabs with 4 spaces, but I almost always tap the spaces by hand anyway; never assume, all that.

        1. Anonymous Coward
          Anonymous Coward

          Re: A question

          Why would you configure vim like that, when the correct number of spaces is 3?

          1. h4rm0ny

            Re: A question

            Look at the pair of you arguing over whether the correct number of spaces is 3 or 4 (or any other number). Spaces are not a standard. Spaces are just a doorway to lots of different individual preferences. Tabs are a standard because the person who wants four spaces width sets tabs to display as that and the person who wants three spaces width sets tabs to display as that and neither is messing up things for the other.

            Tabs are the only logically correct standard to settle on. Everyone who thinks differently is an idiot.

            Also, I resent the article calling me a fanatic just because I can prove that I'm right!

            1. John Lilburne Silver badge

              Re: A question

              Coding styles mean that anyone looking at code in any editor, or on any machine within the organisation, see the same layout. That the layout doesn't change based on the vagary of which developers machine one is sitting at, or which editor they happen to use. TABs converted to spaces such that they adhere to organisational layout standards are the best way forward. Some sites also dictate a maximum line length, if DevX decides on TAB stops every 6 columns and the organisational standard is every 2 columns then

              DevX's code is going to look to look like they've wrapped code at artificial places.

      2. Peter Gathercole Silver badge

        Re: A question

        Inserting tabs anywhere other than the beginning of a line gives different results from inserting a fixed number of spaces.

        If you're using a tab after some other text on a line, the tab will take you to the next tab stop. This could be the equivalent of one or more spaces.

        For example. If you are currently on column 12, and have tab stops set every 8 columns, pressing tab will take you to column 17.

        To do the same with spaces, you would insert 5 spaces.

        If you were on column 14, a tab will still take you to column 17, but you would only need 3 spaces to do the same.

        This means that you can't get meaningful results with global substitutions of fixed numbers of spaces.. Programs like cb are clever enough to properly interpret tabs, and fill in with the variable number of spaces necessary to preserve alignment.

        I use tabs to align trailing comments in my shell scripts (I know, it's a bad habit, comments should really be on their own lines, if only to inflate the number of lines of code written). Putting it through some global substitution really messes the formatting of these types of files.

        I did once attempt to standardize of tab stops every 4 columns set in VI to reduce line-wrap, but I used so many systems, each of which had to have .exrc files, that I soon abandoned it and reverted to accepting tabs every 8 columns.

        The habits of 39 years of writing shell scripts and other free-form languages is difficult to break!.

        1. streaky Silver badge

          Re: A question

          I can't believe we're still on this because there's one correct way of dealing with spaces and tabs. Before code use tabs, and for end of line indentation use spaces. Works in all situations and all time zones.

          It amazes me there's still people clueless enough to use one or the other.

          Using spaces alone makes a MESS, and it smashes all over user preference.

        2. h4rm0ny
          Boffin

          Re: A question

          ">>his means that you can't get meaningful results with global substitutions of fixed numbers of spaces.."

          So you're saying spaces are a substitute for people who can't handle regular expressions. Now THAT I would believe.

      3. Novex

        Re: A question

        I still have to code in VBA (don't ask) and that creaky, old system uses tabs to insert spaces, and iirc it does so anywhere in the line (though I don't have an example to hand right this minute to check for sure).

        I use it at four spaces, though I've seen two, and even three used by other developers.

        Do I get paid even £43K? Like hell I do :(

    2. Anonymous Coward
      Anonymous Coward

      Re: A question

      Just rather be a steely eyed spaceman than a soda chugging tabman. Besides, I charge by the keystroke.

    3. Mark 65 Silver badge

      Re: A question

      Don't most IDEs these days have a setting to convert tabs to spaces?

    4. John Brown (no body) Silver badge

      Re: A question

      Maybe older programmers get paid more due to years of experience and grew up with 80 column terminals so tabbing across causes more line-wrap that necessary whereas aligning using only the even numbered columns helps keep lines shorter. Although I first learned programming using 80 column coding sheets, then 80(ish) column teletypes, I also had to deal with 40 column x 25 line CRT CBM PET and 64 column x 16 line TRS-80. Keeping my code compact and lines short is deeply ingrained.

      1. Peter Gathercole Silver badge

        Re: A question @John Brown

        If you are old enough to remember card punches, you may remember that you could have a format card that you would load into a punch that programmed the punch to put tab stops in relevant places on the cards you were punching. Somewhere on YouTube, there is an example of someone doing this with an IBM 029 card punch.

        It's a very long time since I programmed using punch cards, but in my first job, writing RPGII, the fields in a line in the various program section were of fixed width, and it was possible program the punch to use the tab key to move you to the correct column without having to hammer the space bar. Provided a quite useful speedup when punching.

        1. Richard Plinston Silver badge

          Re: A question @John Brown

          > If you are old enough to remember card punches, you may remember that you could have a format card

          Most of the card punches that I used didn't have a format card, nor a keyboard, and didn't even plug in*. The punch room staff were most upset if we used their machines. The ones that I could use were portable 'hand punches'. They had a block of 12 keys plus space and tab which were pressed in various combinations to get the required characters, and stepped the card along a track. There was a square bar on the rear where tags could set the physical tab stops. I could probably still keep up a reasonable speed for alpha-numeric, special characters would slow me down.

          I also still have an ICL interpreting hand punch. This had a drum that was turned to the required character then pressing a bar would punch the card and also print the character using a tiny ink ribbon. This too had mechanical tab stops.

          * actually some of the IBM hand punches were powered, they had relays that assisted the key presses.

    5. Stuart 22
      Trollface

      Re: A question

      What is this thing called 'indented code'? Is it for those who can't do machine code? And why should we pay them more?

      1. Wayland Bronze badge

        Re: A question

        Code formatting is a waste of storage. Write all your code on one line.

  2. Notas Badoff
    Boffin

    Hey, did you know the editor could do that automatically?

    "... is the equivalent of an extra 2.4 years of experience in terms of salary expectations."

    Haven't looked at the survey yet, and don't know whether this fact can be extracted, but is it just possible that using spaces correlates with an extra 2.4 years or so of experience?

    That it might take an extra couple years to discover how to make your favorite editor expand tabs to spaces as you type - so there is are no extra characters to type - is disturbing but I could believe of some I've worked with.

    1. bombastic bob Silver badge
      Flame

      Re: Hey, did you know the editor could do that automatically?

      the 'droid IDE goes way too far in this regard, and if you're not careful, it wants VERY much to re-format your nice Allman-style code into crappy-looking K&R code. bleah.

      just tell the IDE to convert those tabs into spaces, select 2 spaces per tab column, and you get the best of all worlds, no excessive right-margin widths, lots of indenture, and readable via 'less' 'nano' or any complicated IDE when you're done with it.

      (and stop it with the K&R code, especially "} else {", so that humans can read what you wrote more easily)

      1. Jeffrey Nonken Silver badge

        Re: Hey, did you know the editor could do that automatically?

        I hate K&R style, so I gave you a thumbs up. Apparently it's still popular, though, given the three thumbs down.

        On Windows there's a free pretty-print editor called Artistic Style that works very nicely if you're on Windows and insist on K&R. But you'll never read my code anyway nor I yours, likely.

        I find it fascinating that Swype has K&R in its stock dictionary.

        1. Dazed and Confused Silver badge

          Re: I hate K&R

          If you hate K&R you should be banned from using any system that's based on the fruits of their labour. So not just Unix and Linux based systems (so no Apple or Android) but no Internet either.

      2. This post has been deleted by its author

      3. Anonymous Coward
        Anonymous Coward

        Re: Hey, did you know the editor could do that automatically?

        crappy-looking K&R code

        As a non-programmer I'd be interested to hear how you code Kidnap & Ransom (which is what K&R means in my more security focused world).

        PS: only kidding, I haz Google :).

        Joking aside and more on topic, there's a difference between code and intent. I use tabs because it signals an alignment decision to my editor (yes, even non-programmers occasionally have to hack code).

        It depends on editor and environment if that is converted into spaces, but you are in effect having the same debate that you have when people use a word processor and manually format whole documents instead of using styles which sets the scene for a LOT of extra work afterwards if someone makes a design or layout change (slight aside: IMHO, an introduction to styles and their use ought to be mandatory before people are ever allowed near a word processor, especially if they write more than a single page).

        With tabs, I can change how they are represented. When I DID write code in the days of ZX80, Turbo Pascal and Paradox Application Language, indentations were two spaces because 40 or 80 columns is not a great deal of space to work with, and otherwise a printout would suck.

        Now an indentation is 3, 4 or even 8 spaces provided you translate into characters, but if you want to change that you have a problem with hard spaces as you have in effect the manual formatting as mentioned before. With tabs it's a matter of changing what they represent (their "style") and voilà, your new formatting awaits.

        So I'd venture that tabs are more efficient, not just because of the savings in keystrokes but also in increased flexibility. That's my personal view and experience, but, as I mentioned, I stopped coding around the time people started with object oriented and event based coding so there may well be better arguments out there. I'll be reading a lot, I reckon :)

    2. Ian 7
      Trollface

      Re: Hey, did you know the editor could do that automatically?

      Isn't 2.4 years the amount of time a front end, JavaScript-framework programmer has to become expert in what they do before their skills are rendered completely irrelevant by TheNextBigThing.js and they have to start again? Ahem.

      <workExperience>

      <bitterFormerCICSBMSMapDev />

      <evenBittererIBelievedInAngular1.0ThenAngular2.0CameOutDev />

      <totallyApocalypticReactJSSayWhatNowDev />

      <thankGodForServerSideCodeDev />

      <oldTechnologiesNeverDieTheyJustResurfaceWithNewPackaging />

      </workExperience>

      1. Jeffrey Nonken Silver badge

        Re: Hey, did you know the editor could do that automatically?

        "Isn't 2.4 years the amount of time a front end, JavaScript-framework programmer has to become expert in what they do..."

        I wouldn't know. When I had 2.4 years' experience, JavaScript had at least a decade before it would be a gleam in its father's eye.

      2. andygrace

        Re: Hey, did you know the editor could do that automatically?

        Forget the tabs, spaces thing...what about all these abominations?

        #include <everyLibraryInTheKnownUniverse>

        boolean cant_bear_people_who_waste_loads_of_bytes_with_underscores = true;

        boolean whilstEverythingElseIsCrushedTogetherAndDescriptiveToThePointOfSilly = true;

        Life was so much better when all we needed to do is use a single directive like EQU $8000 (or even fancy-pants EQU &8000 for Acorn aficionados) Real coders write stuff like ...

        SEI:PHP:PHA:TXA:PHA:TYA:PHA

        // etc - no spaces, no tabs, no bloomin' anything. Have stack, accumulator and a couple of other registers - who needs anything else? Oh.. but hang on -

        PLA:TAY:PLA:TAX:PLA:PLP:CLI

        BRK

        .ASCII AndyG

        BRK

    3. John Lilburne Silver badge

      Re: Hey, did you know the editor could do that automatically?

      Better yet the site that you work at ought to have a preferred layout style built into the preferred editor that you use. If someone is wilful enough to change the style or to not use the sites preferred editor, for something that doesn't matter a jot, then they are probably wilful enough to subvert other standards too.

  3. Richard Lloyd

    Tabs are inconsistent...

    Text editors can often allow you to set a different column width for a tab, but if you set it to anything other than the "standard" 8 spaces (which you surely would if you're a programmer because 8 is too wide for nested indentation), then good luck if you ever want to kill a tree and print it out.

    I suspect most printer driver filters for text files are hard-coded to 8 spaces for a tab, resulting in completely unaligned print-outs where <8 spaces for a tab have been used. Yes, you could run it through a "de-tabifier" first before printing, but that would just prove that using tabs is less than ideal (especially for print-outs).

    Also, if you set, say, 3 spaces for a tab, what happens if you need to align something on something other than 3-space multiple? Yep, you end using a mixture of tabs and spaces - yet another negative aspect of using tabs. It's spaces all the way for me, baby :-)

    1. Charles 9 Silver badge

      Re: Tabs are inconsistent...

      My style is to never mix, and to ALWAYS indent consistently. That way, even if tab width changes, it stays organized. In line comments are less of an issue to me.

    2. Charles 9 Silver badge

      Re: Tabs are inconsistent...

      "Also, if you set, say, 3 spaces for a tab, what happens if you need to align something on something other than 3-space multiple? Yep, you end using a mixture of tabs and spaces - yet another negative aspect of using tabs. It's spaces all the way for me, baby :-)"

      I simply ask, "Do I REALLY need an off-tab alignment?" If so, then perhaps the formatting style is wrong and I should adjust it to make them always tab-aligned. I mean, just what would absolutely need a non-multiple alignment?

      1. Vic

        Re: Tabs are inconsistent...

        I mean, just what would absolutely need a non-multiple alignment?

        PEP8 :-(

        Vic.

      2. Richard Plinston Silver badge

        Re: Tabs are inconsistent...

        > "Do I REALLY need an off-tab alignment?"

        Tab stops originated on typewriters more than a century ago. The stops were physical tabs that were placed on a notched bar at the back of the machine at the points required by the typist. Later, card punch machines used a 'format card' that would be punched to give the required actions. In both cases the 'tab' key gave the number of spaces that was wanted. This is the correct way for all purposes.

        I had an editor that catered for setting specific tab stops. The user could set the specific columns for a particular language or file type and the 'tab' key would go to the next tab stop. This was particularly useful for COBOL where the tab stops were 7,8,12,16,20,24,...73. Of course it inserted the necessary number of space characters to get there to prevent incompetent programmers from screwing up the code by using inferior tools and settings.

        1. Anonymous Coward
          Anonymous Coward

          Re: Tabs are inconsistent...

          "In both cases the 'tab' key gave the number of spaces that was wanted. This is the correct way for all purposes."

          Now you are talking about different things. A typewriter had fixed width fonts so a tab would directly relate to a set number of spaces.

          In a word processor with kerning and variable width letters the standard tab specifies an exact distance from the margin or page edge, so that you can still align indents etc.

          In that case a tab specifying a number of spaces is not the correct way as nothing would line up at all. Therefore it is not the correct way for all purposes.

          1. TRT Silver badge

            Re: Tabs are inconsistent...

            I always used a fixed width font for code. It helps lining up similar blocks of code and makes it easier to spot rogue characters. Keeping variable names a consistent length helps as well - it's also fun trying to think up alternative words for describing a variable's use that has the same number of characters.

    3. david 12 Bronze badge

      Re: Tabs are inconsistent...

      >I suspect most printer driver filters for text files are hard-coded to 8 spaces for a tab, <

      I suspect that only a person who doesn't use tabs could believe anything like that.

  4. Louis Schreurs BEng

    correlation is not causation.

    All I wanted to say to EEEEEVREBOOOODY in science.

    1. John Smith 19 Gold badge
      Unhappy

      "All I wanted to say to EEEEEVREBOOOODY in science."

      That's sort of drummed into most scientists from the first day on their courses.

      Other people. Not so much.

      1. Anonymous Coward
        Anonymous Coward

        Re: "All I wanted to say to EEEEEVREBOOOODY in science."

        Yes, everyone in science understands it. The marketroid in the institution's PR department, who writes press releases about the latest research, doesn't. Nor do the mainstream journalists who receive the press release, and write stories based on it instead of the original paper.

    2. thames

      Re: correlation is not causation.

      Yes, correlation is not causation. If you analyse a set of data enough ways, you stand a strong chance of finding various meaningless correlations purely by chance. They could just as easily have found, by chance, a correlation between pay levels and the colour of your underwear.

      This is a common mistake amongst people who don't actually understand statistics well enough.

      1. Anonymous Coward
        Anonymous Coward

        Re: correlation is not causation.

        In this case it is causation though, check out Will Godfrey's post further down in the comments where he's identified the mechanism.

      2. Pomgolian
        Joke

        Re: correlation is not causation.

        ..and the correlation between pay and no underwear most probably correlates even more closely.

    3. diodesign (Written by Reg staff) Silver badge

      Re: correlation is not causation.

      Aw come on, don't kill the fun.

      (PS: we say in the piece that correlation is not causation.)

      C.

  5. Louis Schreurs BEng

    tabs take fewer keystrokes

    _= one keystroke, or isn't it?

    1. Anonymous Coward
      Anonymous Coward

      Re: tabs take fewer keystrokes

      That's why we're paid more :P you can configure pretty much anything (Notepad++ etc.) to insert 4 spaces when you press the tab key and detect them and delete 4 spaces on backspace. :) Same key presses, consistent layout across editors/OSs.

      1. bombastic bob Silver badge
        Happy

        Re: tabs take fewer keystrokes

        "you can configure pretty much anything (Notepad++ etc.) to insert 4 spaces when you press the tab key and detect them and delete 4 spaces on backspace"

        true. and then ANY text-based program or editor (say 'less' or 'nano') will show what you did exactly as you did it, always lining up, always consistent, etc..

        1. h4rm0ny

          Re: tabs take fewer keystrokes

          >>true. and then ANY text-based program or editor (say 'less' or 'nano') will show what you did exactly as you did it, always lining up, always consistent, etc..

          Consistent with itself, yes - just as it would be if you used tabs. But not consistent with files from other authors such who used a different number of spaces. Whereas tabs would be.

    2. Adam 1 Silver badge

      Re: tabs take fewer keystrokes

      Unless your still programming in vi, I don't think you are actually typing these spaces. Of the 2 modern(ish) IDEs I've used this week, pressing enter will indent automatically to the same point on the next line. Opening a brace and pressing enter will indent you one more. Closing will unindent.

      Heck, resharper will with a keyboard shortcut automatically apply the standard company wide formatting rules across a whole file/project/solution.

      1. Ferry Michael

        Re: tabs take fewer keystrokes

        If you're an experienced user of vi you will know that you can put a number in from of your commands, so even inserting 64 spaces only requires "64i<space><ESC>" - 5 characters

      2. jake Silver badge

        Re: tabs take fewer keystrokes

        What's wrong with vi? I do almost all my writing/coding in vi!

        When I need an IDE (rare), I use EMACS ... with a good subset of vi keybindings ;-)

        1. Adam 1 Silver badge

          Re: tabs take fewer keystrokes

          Who said anything is wrong with vi? It's a text editor and a perfectly good one if you can get past its steep learning curve. I simply made the point that with modern IDEs, you don't type in spaces or tabs.

        2. John Brown (no body) Silver badge
          Coat

          Re: tabs take fewer keystrokes

          "What's wrong with vi?"

          It's not EMACS!

      3. Bandikoto

        Re: tabs take fewer keystrokes

        >Unless your still programming in vi, I don't think you are actually typing these spaces. Of the 2 modern(ish) IDEs I've used this week, pressing enter will indent automatically to the same point on the next line.

        And this is why I hate looking over someone's shoulder as they attempt to use vi. Vi has had autoident since I first encountered it in 1981. ":set autoindent" and be done. Also of use: ":set shiftwidth=MYPREFERREDINDENT" and the ^T and ^D insert mode commands, which head out to your next indent and unindent for you, respectively. In command mode, you would enjoy <MOTION and >MOTION, often used as << and >>.

  6. Richard 12 Silver badge

    Just let the IDE do it.

    Costs zero time or effort.

    All IDEs have a formatting ruleset and trivial "apply to whole selection/whole file" command.

    Which is probably why the better paid use spaces, because the default for MSVC is spaces and it's just not worth the effort to change it.

    Namespace and Switch/Case statement indentation is another holy war. Let's have that one next.

    1. Dan 55 Silver badge
      Megaphone

      Re: Just let the IDE do it.

      Allman (AKA BSD).

      And tabs.

      I'll follow whatever style is already there, but if it's different to Allman and Tabs then I do it knowing that Allman and Tabs is the best way.

      1. bombastic bob Silver badge
        Devil

        Re: Just let the IDE do it.

        "Allman (AKA BSD)."

        YES!

        "And tabs."

        NO!

        (you are obviously a member of a rebellious sect)

      2. Jeffrey Nonken Silver badge

        Re: Just let the IDE do it.

        Allman and tabs here. I'll adjust to Whitesmiths without much trouble.

        FTR I have a bit more than 2.4 years of experience.

    2. HieronymusBloggs Silver badge

      Re: Just let the IDE do it.

      "Costs zero time or effort."

      So abandoning vi, then installing and learning an IDE will cost me zero time or effort?

    3. Ken Hagan Gold badge

      Re: Just let the IDE do it.

      "because the default for MSVC is spaces and it's just not worth the effort to change it."

      Is it? I haven't poked around in that part of the IDE for several versions and it always does tabs for me. I must have set it correctly at the beginning of my career and never looked back.

  7. jake Silver badge

    Back in roughly 1975, one of my mentors had a bumper-sticker:

    Tabs are for typewriters!

    A woman from the typing pool who much preferred Fresca to Tab took exception to the comment, so he offered to buy her lunch in compensation for the perceived slight. They are still married.

    Personally, I prefer spaces, but I'll use tabs where required. When in Rome & all that.

    1. Rich 11 Silver badge

      Re: Back in roughly 1975, one of my mentors had a bumper-sticker:

      They are still married.

      To each other?

      1. jake Silver badge

        Re: Back in roughly 1975, one of my mentors had a bumper-sticker:

        Yep. Quite happily, too. About to become Great Grandparents. They are insufferable. :-)

  8. bob, mon!
    Trollface

    Of course there's a right answer!

    Mine! Spaces are the ONLY way to go!

    Do you KNOW what happens when you press the TAB key on an IBM 029 card punch? Do You?? DO YOU?????????

    NOTHING, if you're good! Card punches don't have TAB keys --- the 029 has an Error Reset key there, like the Good Lord Watson intended! You tryin' to put spaces in your FORTRAN source, you're living in a state of SIN! Repent! Space out!

    There's a reason it's called "whitespace", not "whitetab".

    1. frank ly Silver badge

      Re: Of course there's a right answer!

      I thought you were going to say, "A puppy dies!!".

    2. Phil O'Sophical Silver badge

      Re: Of course there's a right answer!

      You tryin' to put spaces in your FORTRAN source, you're living in a state of SIN

      Fortran ignores spaces, except for those essential first 6 columns. No TABs there.

    3. Munchausen's proxy
      Pint

      Re: Of course there's a right answer!

      ===

      "Do you KNOW what happens when you press the TAB key on an IBM 029 card punch? Do You?? DO YOU?????????

      NOTHING, if you're good! Card punches don't have TAB keys --- the 029 has an Error Reset key there, like the Good Lord Watson intended!"

      ===

      Well, duh. You put your tabs on the drum card.

    4. Jeffrey Nonken Silver badge

      Re: Of course there's a right answer!

      There is some kind of column skip function... Been a while, sorry. But I know, because I used to use it all the time... with drum cards. I was really good at making drum cards.

      The end result was that the tab-equivalent inserted spaces.

      I don't consider my experience with the 029 OR the 026 to be directly relevant to my work today, though I've never broken the bad habit of using left-side-only control keys that it forced me into.

    5. Herby Silver badge

      Re: Of course there's a right answer!

      Anyone who knows about keypunches KNOWS that yes there is a TAB key on an 029, and it is called the SKIP key. You set the columns you want to skip to on the drum card as god intended (you did take that class didn't you). Thankfully you could select on an 029 which settings you could use (PROG 1 and PROG 2) so the first was Fortran, the second was your Assembler (which had different tabs fields than the Fortran program did. When you used assembler, the skip positions were columns 10, 19, 37 as the proper gods determined. This allowed for 8 character labels.

      Of course when you went to terminals (an ASR33 for sure), the software set things to have a tab every 8th column, so you used to after you typed your statement number in Fortran. Then tabs were ALWAYS set to 8 characters, and if you have a reasonable editor, it put them in for you even if you pounded on the space bar.

      Of course when I was in typing class, the standard indent for paragraphs was 5 spaces, but that was a LONG time ago. Now it is 1/2 inch, which is the same thing on 10 cpi fix spaced fonts.

      1. Jonathan 27 Bronze badge

        Re: Of course there's a right answer!

        Every time I read one of these long threads about punch cards it makes me so happy that I was born after the invention of the IBM PC and never had to deal with those things. I don't think anyone has ever said anything nice about punch cards.

        P.S. Visual Studio automatically converts tabs to spaces by default, and I'm sure other IDEs do too (didn't bother checking, not worth it). This makes the metrics used in this story totally worthless.

        1. aks Bronze badge

          Re: Of course there's a right answer!

          i miss punched cards.

          they were perfect for serving slices of cake around on someone's birthday.

          the boxes to hold 2,000 cards came as flatpack and needed to be folded before use. we had competitions to see who could fold one the fastest. i won in 29 seconds, but i was a computer operator with ibm at the time.

    6. John Savard Silver badge

      Re: Of course there's a right answer!

      It is true that if you tried embedding a tab character in a program on punched cards, you would have to manually overpunch the 12-5-9 combination.

      But an 029 card punch does have the equivalent of a tab key. You just have to wrap a special punched card around that little drum behind the door with a window in it, putting holes where you want the tab stops, and press... what was it called, the "field skip" key? Ah, just "skip". And you would use "mult pch" to get a 12-5-9.

  9. FelixReg

    Maybe experience teaches you to not use tabs

    I've seen source code hard tabs for all indents from 2 through 11.

    Guessing the value for given file is not fun.

    Tabbed source is smaller on disk than spaced? Good to know. My 128k floppies will like tabbed code.

    1. Charles 9 Silver badge

      Re: Maybe experience teaches you to not use tabs

      "Guessing the value for given file is not fun."

      I see it as, if it's done correctly, it shouldn't matter what the tab width was, it should still all line up neatly if the indentation was done properly and consistently. In which case, why both guessing? Just pick a number and get on with it.

  10. Timmy B Silver badge

    We have a tab rule here mainly because we are a team. We settled on tabs because if I want my indents at 4 spaces and pally over the room wants 3 then it's easy to change our IDE to show either IF tabs are used. If he went coding with spaces and put in 3 and I put in 4 then it'd all be a royal inconsistent mess. I wonder if more of the developers earning more and using spaces were not in teams and thus contractors or similar, who tend to earn more.

    1. AJ MacLeod

      Thank you Timmy B for pointing out what I have always thought the most obvious thing in the world, but which apparently passes clean over the heads of at least half the IT world!

      I thought it very telling that the spaced out were not actually claimed to BE more experienced than Tab users, just that they were more highly paid...

    2. caffeine addict Silver badge

      That's always been my thinking too. Use tabs and you can set them to whatever the hell you want.

      No-one has ever given me a convincing argument for using spaces - to the extent that I've come to the conclusion that a handful of famous coders have used spaces and everyone else is going along with it like a cargo cult.

      1. sabroni Silver badge
        Happy

        How to know you've made a good point?

        Lots of downvotes but no rebuttal.

    3. Paul Crawford Silver badge

      I tend to use tabs, because Makefiles demand it.

      However python demand spaces.

      Both are stupid because humans don't care and many editors make it non obvious. Finally there are tools like 'indent' that can fix C/C++ code to whatever format you like. And make it consistently so, which is probably more important than anything else.

      1. Vic

        However python demand spaces

        It doesn't; you can use tabs.

        It's usually quite dangerous to mix the two, though.

        Vic.

      2. thames

        @Paul Crawford - "However python demand spaces."

        As pointed out by Vic, Python will work just fine with either spaces or tabs, whichever you prefer. You just can't mix them together in the same syntactic block. The Python compiler will give you a syntax error if you mix spaces and tabs in an ambiguous manner.

        As an example, supposed I have a small program where I have some print statements inside an if statement. If I indent the first print statement using tabs, but indent the next line an equal amount using spaces, I get a syntax error at compile time. Even though visually it looks the same, the compiler detects the mix and gives you a specific error message pointing to a specific line. This happens at compile time, not during execution. Here's the error message.

        File "./test.py", line 5

        print('Maybe')

        ^

        IndentationError: unindent does not match any outer indentation level

        Python enforces consistent indentation as part of the language syntax. This is a design feature, as it eliminates entire classes of bugs which would otherwise result from you looking at code structure based on indentation and the compiler ignoring it.

      3. Richard Plinston Silver badge

        > I tend to use tabs, because Makefiles demand it.

        Most editors will have a simple 'insert special character' function. My editors are set to replace tab key with spaces to next tab stop and to show tab characters. For make files it only needs Ctrl-P Ctrl-I to get the required tab character. They show as a green block to indicate they are tabs, Thus I get the best of both worlds.

    4. Anonymous Coward
      Anonymous Coward

      Anyone who uses tabs has clearly never found themselves having to read a script on a server where the only available text editor is Notepad.

      If you want to align to character position part-way along the line above, you can't do that with tabs that could vary in size. You have to uses spaces.

      Here's a random example line from the first page I found by typing "example code" into Google:

      assert (board != null) && (board.length > 0)

      && isSquare(board) && onlyContains(board, validChars)

      : "Violation of precondition: queensAreSafe";

      They have actually used tabs, and the programmer used 2 extra tabs to put && isSquare underneath board != null. His or her tabs were set to 4 chars so 2 tabs = "assert (". Try reading the file with tab size set to anything else and the layout is screwed up.

      1. Anonymous Coward
        Anonymous Coward

        In which case I would say the style is wrong. If you're going to use tabs, use them consistently and in a way that you should NEVER indent with spaces. In which case, keeping the tabs is more important than character-aligning the &&'s and perhaps a single tab indentation (to indicate a continuation) would be the preferred style if it can't stay in a single line.

      2. AJ MacLeod

        "Anyone who uses tabs has clearly never found themselves having to read a script on a server where the only available text editor is Notepad."

        I would argue that a server where Notepad is the only editor available is broken anyway...

        1. Richard Plinston Silver badge

          > would argue that a server where Notepad is the only editor available is broken anyway...

          and not only because it is running Windows.

      3. h4rm0ny

        >>Anyone who uses tabs has clearly never found themselves having to read a script on a server where the only available text editor is Notepad.

        Found your problem and it's not with tabs. Seriously, if we have to design everything around the lowest common denominator, we might as well call it a day on this species now.

    5. Jeffrey Nonken Silver badge

      I'm guessing none of you uses end-of-line comments, or you don't align them.

      ...yeah, I know. High maintenance, frowned upon mightily. I find it very readable, though.

      OTOH probably none of you program in assembly, either.

      1. Charles 9 Silver badge

        Inline comments? I generally don't align between lines. I usually just tab out from the end of the line once or twice to get some space and go from there. Since they're most pertinent to the specific line, I just go from there. If they're a cluster of single lines, I may attempt to tab-align, but these comments tend to be brief as well, so if they misalign due to changed tab width, it's just a mild nuisance at that point. More important comments I use whole lines and align with the code, meaning it moves along with the tabs and stays lined up.

        PS. I've done assembler, and I DID tab-align, there. Thankfully, assemblers tend to have a restricted grammar that makes aligning labels, opcodes, arguments, and so on easier. And as long as you stick to a general rule of thumb of setting a generous tab width (6 at a minimum, 8's a good rule of thumb, more or less depending on your architecture), it tends to read just fine.

  11. Anonymous Coward
    Anonymous Coward

    IDE's promote Tabs? Possibly

    But there again, the Eclipse[1] based toolkit I've been using recently replaces the tab with a configurable number of spaces. Best of both worlds perhaps.

    [1] Yes I know that for many, Eclipse is Satan in disguise but some applications have pretty decent toolking based upon it and you don't have to produce Java/Javascript with it you know.

    1. bombastic bob Silver badge
      Devil

      Re: IDE's promote Tabs? Possibly

      every decent editor lets you change between tab or spaces, and set the default tab to "something other than 8". Then hit the tab key if you want, or let it 'auto tab' for you. problem solved.

      I've been using pluma for coding, lately. works pretty well. for make files I use 'nano' or 'ee' to keep the hard tabs.

  12. Anonymous Coward
    Anonymous Coward

    Thou shalt indent to three, no more, no less.

    Three shall be the number thou shalt indent, and the number of the indenting shall be three.

    Four shalt thou not indent, neither indent thou two, excepting that thou then proceed to three.

    Five is right out.

    Then K&R coders, being naughty in my sight, shall snuff it.

    1. John Smith 19 Gold badge
      Happy

      "Thou shalt indent to three, no more, no less."

      So mote it be?

    2. MJI Silver badge

      aghhhhhhhh

      2 or 4 nothing else for me

  13. Putters

    If Only ...

    Now, if only there was a way to, I dunno, Search and Replace all those Tabs with 3 spaces ... I could get paid more ...

    1. bombastic bob Silver badge
      Devil

      Re: If Only ...

      someone else already mentioned the linux/BSD 'indent' utility

      what's more irritating to ME is editors that allow white space at the ENDS of lines... (I specifically wrote a utility to trim these in-place, which I must run once in a while)

      1. Richard 12 Silver badge

        Re: If Only ...

        Several IDEs strip end-of-line whitespace automatically.

        (Obviously you can turn this off)

        Sure, if you're not using an IDE that understands your language of choice then you don't get any of this. But you're also going to be orders of magnitude slower and make more mistakes.

      2. Richard 12 Silver badge

        Re: If Only ...

        And all the decent version control software has easy hooks for tools that enforce your chosen styles both in the repo and your local disc.

        It's even built into some of them.

        So really this is just bollocks. I can use what I like and you can use what you like and neither of us has to affect the other.

    2. Ramazan

      Re: if only there was a way to, I dunno, Search and Replace

      :help :retab

  14. Milton Silver badge

    WGAFF??

    People actually care about this? Enough to argue about it?? Who knew?!

    Surely 99% of professional coders use an IDE, which doesn't care and takes care of trivia anyway, and modern compilers and/or tokenisers and/or interpreters, which don't care, writing code for systems which wouldn't care if they even knew, to be used by customers who really couldn't give a flying fart?

    I use tabs cos my IDE makes it utter simplicity and my ancient wrists have better things to do than repeatedly bash the space bar. (No jokes please.)

    It isn't even April 1st.

    1. Voland's right hand Silver badge

      Re: WGAFF??

      Try submitting code with tabs to QEMU or code with spaces to Linux kernel. If you write for both you end up growling all the time because you have written something without changing the formatting config and you now need to reformat it.

      1. jake Silver badge

        Re: WGAFF??

        Might want to ask the left hand if computers are any good at quickly and painlessly reformatting things like source code ...

      2. bombastic bob Silver badge
        Devil

        Re: WGAFF??

        " If you write for both you end up growling all the time"

        solution: add different users with different editor settings. If you use X11, you can 'su' to the user, and (unless you're on a system that b0rks this) use X11 as a different user via the 'DISPLAY' environment variable. Ok there ARE some systemd configs that b0rk this. But it works right with Debian 8 and of course FreeBSD.

        Or you can log in to the correct user via gdm or whatever.

        And of course THIS is a reason NOT to use Wayland, so you CAN have 3 or 4 different users with different editor settings (stored for each user naturally) working on 4 different projects at the same time, etc. etc. etc..

        (works well for specific customer projects too)

        Yes. CAN!

    2. Vic

      Re: WGAFF??

      People actually care about this? Enough to argue about it??

      Python coders do. Using the wrong form of whitespace suddenly makes your code fail...

      Vic.

    3. Richard Plinston Silver badge

      Re: WGAFF??

      > ancient wrists have better things to do than repeatedly bash the space bar.

      I never understood why people think that one needs to 'bash the space bar' when the tab _key_ can produce the exact required number of space _characters_ (with appropriate editor settings).

      If your editor cannot do that then get better tools.

  15. RachelG

    What about spaces *and* tabs?

    Yes, there *is* such an indenting style. Java Style Guide used to mandate this in ye olden days, not any more: tabstops set to 8, but indent by four. So one indent is four spaces, two indents is tab, three indents is tab, four spaces, four indents is two tabs, etc.

    No, I don't use it, not now I have a choice. I have nothing but hate for it. Most editors can't even support it for both viewing and typing. But some nutters seem to actually prefer it.

    Me? Used to be all-tabs, now all-spaces, but it doesn't seem to have much impacted my salary.

    1. Voland's right hand Silver badge

      Re: What about spaces *and* tabs?

      The result of this style is Dog's breakfast in the SCCM and patches fail half of the time.

      This is why it is prohibited by every project I can think of.

    2. Ramazan

      Re: What about spaces *and* tabs?

      "Most editors can't even support it for both viewing and typing"

      Bullshit. All editors, I mean both of them do support that. Even more, this indentation style is the default IIRC.

  16. Will Godfrey Silver badge
    Happy

    Missing the point

    It's obvious really. Use spaces, all typed individually by mashing the spacebar on the most rattly keyboard you can find.

    The boss hears the staccato rat-a-tat-a-tat for hours at a time, and is amazed at your industriousness. So more dosh!

  17. Your alien overlord - fear me

    RPG/28 and RPG/400

    Try programming that with spaces - for people under 50, it's the programming language for IBM System/38 and System/400 mini-computers.

    1. Anonymous Coward
      Anonymous Coward

      Re: RPG/28 and RPG/400

      I may be getting old, but I am sure it was never called RPG/28.

      Column formatted code - that will upset the space/tab obsessives...

    2. Richard Plinston Silver badge

      Re: RPG/28 and RPG/400

      > for people under 50

      For people under 60, RPG goes back way before System 38. I encountered it on a Univac 1004 where the compiler was a plug board and a card pack.

  18. Still Water

    If you have to worry about this, you need a new IDE.

  19. Anonymous Coward
    Anonymous Coward

    My code won't run but the spaces are great

    For some coders their works are art, perfectly executed with style and grace for others just getting it to compile/run is all the matters.

    Whilst tabs or spaces makes no difference to the compiler/interpreter then considering it an issue is an exercise in pedantry.

    As to later modification by another coder, do you really want to allow them to sully your art with their dirty finger prints

    1. Marco Fontani

      Re: My code won't run but the spaces are great

      Whilst tabs or spaces makes no difference to the compiler/interpreter

      *cough* Makefiles *cough*

      1. Roland6 Silver badge

        Re: My code won't run but the spaces are great

        >Whilst tabs or spaces makes no difference to the compiler/interpreter

        However, the use of space and brackets will make a difference to human readability - remember there is a good reason why C was regarded as a write only language eg. the compiler knows the correct evaluation order of "i+++j" (and many other similarly constructs) but do youwithout having to look it up?

        I think many here have jumped on the use of tabs for code indenting, however, tabs and spaces are used elsewhere, such as within the code and to separate code from comments. Not read the report, but would be interested if it has conducted some deeper analysis than just simply total the number of tabs and spaces in a module.

        1. Flocke Kroes Silver badge

          Re: My code won't run but the spaces are great

          i+++j is obvious, but a fun way to catch people out is some variation of:

          int divide(int n, int *d) { return n/*d; }

          1. Roland6 Silver badge

            Re: My code won't run but the spaces are great

            >but a fun way to catch people out

            Back in the 80's there were a couple of good books on the joy's :¬ of C - The C Puzzle Book being one.

            We used these and some other sources to both help verify various C compilers (specifically those being newly released for the PC) actually did implement K&R white book C (it was surprising how many didn't in their first release or two!) and determine how various standard C functions behaved (eg. In K&R it was not defined what should happen if a file pointer was moved beyond the end of a file).

        2. Anonymous Coward
          Anonymous Coward

          Re: My code won't run but the spaces are great

          "i+++j" too many cooks spoils the language consistancy and readability.

          B was forgivable, C never was

      2. Anonymous Coward
        Anonymous Coward

        Re: My code won't run but the spaces are great

        "*cough* Makefiles *cough*"

        makefiles are magic and require no interpretation?

        No, they are not, don't forget your coat and crayons on the way out

        1. Anonymous Coward
          Anonymous Coward

          Re: My code won't run but the spaces are great

          >>> Whilst tabs or spaces makes no difference to the compiler/interpreter

          >> *cough* Makefiles *cough*

          > makefiles are magic and require no interpretation?

          > No, they are not, don't forget your coat and crayons on the way out

          He could ask to borrow yours, but you definitely need them more.

          1. Anonymous Coward
            Anonymous Coward

            Re: My code won't run but the spaces are great

            "He could ask to borrow yours, but you definitely need them more."

            So you agree with the poster that makefiles are always CPU executable binaries that require no interpretation?

            I ask as there may not be enough crayons to go around

            1. Anonymous Coward
              Anonymous Coward

              Re: My code won't run but the spaces are great

              > So you agree with the poster that makefiles are always CPU executable binaries that require no interpretation?

              "You" wrote:

              "Whilst tabs or spaces makes no difference to the compiler/INTERPRETER"

              You see, when you write "interpretation", you should realise the similarity to the word "interpreter" isn't a coincidence.

              > I ask as there may not be enough crayons to go around

              That's your fault for eating them.

              This is fun!

              1. Anonymous Coward
                Anonymous Coward

                Re: My code won't run but the spaces are great

                "You see, when you write "interpretation", you should realise the similarity to the word "interpreter" isn't a coincidence."

                Yes well spotted, now try understanding the whole sentence and yes learning is fun.

                To make it easier I will rephase, if the thing you are using to convert your high level programming language into a form the CPU can understand, does not see any difference between TAB or Space then why should you.

                It really is not a difficult concept to understand but clearly I overestimated some of the audience who clearly are not even at crayon level

                1. Anonymous Coward
                  Anonymous Coward

                  Re: My code won't run but the spaces are great

                  > To make it easier I will rephase, if the thing you are using to convert your high level programming

                  > language into a form the CPU can understand, (sic) does not see any difference between TAB or Space

                  > then why should you.

                  Thank-you, captain obvious.

                  To make it easier, I will rephrase: "If the thing thing you are using to convert Makefiles into a form the CPU can understand does not see any difference between TAB or SPACE, then it's broken, as there IS a difference... (Now poppit, don't go pulling that GNU extension excuse)

                  > It really is not a difficult concept to understand but clearly I overestimated some of the

                  > audience who clearly are not even at crayon level

                  That's what you get from looking in the mirror.

                  HAVE A NICE DAY!

        2. John Sanders
          Mushroom

          Re: My code won't run but the spaces are great

          Those who give any kind of meaning to white-space in source code other than to separate one word from another is a heretic and has to be cleansed!

          Yes this goes for python too.

          1. englishr
            Trollface

            Re: My code won't run but the spaces are great

            "Those who give any kind of meaning to white-space in source code other than to separate one word from another is a heretic and has to be cleansed!"

            But...but...what about the awesome programming language 'whitespace' ??

            https://en.wikipedia.org/wiki/Whitespace_(programming_language)

      3. nijam

        Re: My code won't run but the spaces are great

        *cough* Python *cough*

        But then python is an abomination.

      4. Anonymous Coward
        Anonymous Coward

        @ Marco Fontani, sry didn't notice you were Italian

        "Whilst tabs or spaces makes no difference to the compiler/interpreter"

        "Whilst" in above, meaning "while it is true" or "so long as".

        Appologies for those who do not speak UK English natively.

        so in otherwords "if the compiler/interpreter treat space or tab the same then....."

      5. Ramazan
        Facepalm

        Re: *cough* Makefiles *cough*

        The most valid statement comes on the 3rd page of comments... "Devs", they say. +2.4 years to experience. +8.6% to salary, blah blah blah. When you join a dev project, you accept an already established indentation style, and for Makefiles there are no alternatives to tabs at all. So what? If you can't set et/noet, sw, ts and tw or their analogues for your favourite editor on a per-file basis, you have no place in this industry at all IMNSHO. Modelines have been there for tens of years, FFS.

    2. Flocke Kroes Silver badge

      Re: My code won't run but the spaces are great

      When some heinous cretin uses a clueless indentation style, fix it. If they use a consistently stupid style you can reverse the changes and avoid a time wasting flame war. The correct character to use depends on the language.

      1. Anonymous Coward
        Anonymous Coward

        Re: My code won't run but the spaces are great

        "When some heinous cretin uses a clueless indentation style, fix it. If they use a consistently stupid style you can reverse the changes and avoid a time wasting flame war. The correct character to use depends on the language." + "definition"

        When the language is released before programming style is defined then you get a lot of shouting about conventions because the conventions were tagged on as an afterthought.

        Back in the days when RAM was expensive then using TAB to represent multiple indent spaces could determine if your code would fit in memory.

        Now everyone has plenty of RAM and to get some use out it the convention is now to use spaces because, well we can so why not.

        Lastly If you are trying to read someone's else'e source in a text/web viewer then why expect it to be laid out the same as it would be in a IDE? you wouldn't expect a word processor document to look right in notepad, yes they are both just text but for source you require the programmer to do the hardwork rather than the computer.

        Pressing one key to jump to indent columns from line above is much easier then holding space until you go past and deleting to line up just because that RAM is going to waste and to appease people who open your source in the wrong application.

        1. Richard Plinston Silver badge

          Re: My code won't run but the spaces are great

          > using TAB to represent multiple indent spaces could determine if your code would fit in memory.

          If you need to do that then you are not modularising the code sufficiently.

          I developed complete systems on 64Kb machines (CP/M, Wordstar and others) without having to resort to compressing the code by having to use tab characters or shorter variable names or such (and it was COBOL).

          1. Anonymous Coward
            Anonymous Coward

            Re: My code won't run but the spaces are great

            Try it with less than 26.5KB RAM max, the compiler in ROM along with cassette tape storage @1200 CPS with 2 second gap between each 256B block.

            Getting floppy storage and disc based compilation then CPM80 and 64KB was like another world.

            As to developing CPM I thought it was Gary Kildall see https://en.wikipedia.org/wiki/Gary_Kildall

            However, if as you say, you developed "CP/M, Wordstar and others" in COBOL on 8KB RAM machines then my hat goes off to you.

        2. Richard Plinston Silver badge

          Re: My code won't run but the spaces are great

          > holding space until you go past and deleting to line up

          Only if you are using poor or inappropriate tools, or haven't learnt how to configure them.

          1. Anonymous Coward
            Anonymous Coward

            Re: My code won't run but the spaces are great

            "Only if you are using poor or inappropriate tools, or haven't learnt how to configure them."

            I had a 6502 based Acorn BBC Micro, at the time it was not considered a poor tool. As to knowing how to configure it, when you spend your own money on kit then you want to make the best use of it. So I read a lot and programmed a lot across lots of languages as I upgraded it over 10 years so in the end it had a Z80 and a 68000 allowing optimised CPM or a unix.

            See http://chrisacorns.computinghistory.org.uk/docs/Torch/Torch_UnicornTechOverview.pdf

            if you are interested. I could have gone with the 32016 second processor and had a mainframe CPU of my own but by that time the mainframe market was already in decline and it was a lot of money for a niche market.

            So starting out on small computers perhaps gave me the idea that needless waste(bloat) was an anthema, perhaps it is a generation thing. On your loves, I looked at COBOL and personally though meh! why bother when I can do it all in a general purpose language, but you seemed to have made a career out of it so good for you.

            So if my code looks the same and works the same but uses less storage then why is that a bad thing.

            I am sorry if this offends you but to be frank bloat offends me even more.

            1. Richard Plinston Silver badge

              Re: My code won't run but the spaces are great

              > So starting out on small computers perhaps gave me the idea that needless waste(bloat) was an anthema, perhaps it is a generation thing.

              The first computer that I programmed for had 16Kwords (24bit) and 8megabyte disk drives (14 inch). I am well aware of avoiding needless waste. The first one that I had at home had 64Kb and 1megabyte 8inch diskettes on which I developed COBOL accounting and other systems for various clients. Compiles would run all night.

              I also had BBCs and still have a couple here, a Master 512 and a B+.

              > So if my code looks the same and works the same but uses less storage then why is that a bad thing.

              I haven't cared about the difference in storage space between tabs and spaces for decades. I have dealt with code from many other programmers, some with mixes of spaces and tabs. I handle this by making it suit my style. My tools can easily bulk convert between tabs and spaces, so it is not an issue if the code was sent back to a 'tabber'.

              One objection to spaces seems to be that 'tabbers' think that they have to hit the space bar don't seem to know that can be configured.

              1. Anonymous Coward
                Anonymous Coward

                Re: My code won't run but the spaces are great

                @Richard Plinston

                Yes you can change the keyboard repeat rate but the whole point was to move the cursor to the correct position without waiting too long, if you slow it down then you might as well mash it instead or type it all and indent afterwards both bad in their way.

                You seem to be avoiding KB is this a hold out to the old byte being other than 8 bits arguement? you see we all carry around conventions from when we started.

                1. Anonymous Coward
                  Anonymous Coward

                  Re: My code won't run but the spaces are great

                  One example of where avoiding bloat allows code to run that would otherwise not fit in memory was with Kaprekah numbers. This one sticks in my memory because my CS teacher had been whittling on about something he read in read in a forth magazine from the '70s but clearly did not understand.

                  He said "if you take any four digit number where at least one digit is different to the others, then order the digits by magnitude and subtract the higher magnitude order from the reverse order. In a maximum of 7 steps you get 6174 which using the same operation will give itself"

                  He went on to say that scatter plotting the path taken from the numbers that required the highest number of steps that it would reveal a nice spiral, this is utter bollocks as when confront he said you had to rotate the scatter data a bit ! lool

                  Anyway an array of every posssible number between 0001 and 9998 at 16 bits would exheed the memory restrains I referred to earlier if I wanted to avoid saving to tape to be able to plot it. Since there was never going to be a difference between 0123, 1230,3210,1230 etc you can reduce redundancy by using 4 nested loops with each starting at the high loops value. This saves memory, run time and shows that whilst a larger machine could have stored the whole set a bit of thinking means that your code runs faster because of reduce bloat. I could equally have created my own type to fit the data in but I am of the opinion that using what is availible is faster than building it all from scratch (assembler) and since you could plot them with the same 4 loops and this was a one off then I didn't bother going further.

                  If everyone applied that "bit of thinking first" idea then there would not be any bloat at all, or just because you have a loads of storage does this mean you have to fill it with rubbish.

                  The whole TAB/Space arguement to me smacks of complacency.

                  Yes you can do it either way but in computing removing redudancy should shout which is the correct answer.

                  1. jake Silver badge

                    Re: My code won't run but the spaces are great

                    That's pronounced "Kaprekar".

                    1. Anonymous Coward
                      Anonymous Coward

                      Re: My code won't run but the spaces are great

                      @jake thanhyou

                  2. Richard Plinston Silver badge

                    Re: My code won't run but the spaces are great

                    > just because you have a loads of storage does this mean you have to fill it with rubbish.

                    Spaces aren't 'rubbish', they perform a very useful function. In fact you probably have hundreds of space characters in your files: each side of an operator, between words in comments, etc.

                    Also, most source code files on disk do have 'rubbish' filling out the remainder of the final cluster (allocation unit). Changing spaces to tabs may save exactly zero disk blocks at all in the majority of files.

                    > The whole TAB/Space arguement to me smacks of complacency.

                    Bad spelling smacks of complacency too.

                    In my case it has been a deliberate choice that suits my needs best and my tools have been carefully chosen and configured to support that choice. For example I often generate source code from, say database schemas and screen designs, and process code in various ways. Tabs would cause complications and could lead to mixed code with leading spaces and tabs when processed code is added to hand written.

                    I don't care that you made up your mind on the BBC in the 1980s and have never changed. I review and revise my approach as I see fit.

                    > Yes you can do it either way but in computing removing redudancy should shout which is the _arrogant_ answer.

                    FTFY

                    In your code you will have both space characters and tab characters. I find the tab character is redundant because the tab key produces the appropriate number of spaces. If I actually need a tab character I can easily do that.

                    If you use Windows then you probably have 'redundant' carriage return characters following the line feeds.

                    > If everyone applied that "bit of thinking first" idea then there would not be any bloat at all, or just because you have a loads of storage does this mean you have to fill it with rubbish.

                    My experience is different, and more practical than yours. For example I found that access times on randomly accessed data files can be improved (by up to 30%) by making the 'record' size a multiple or sub-multiple of the physical block size as this reduced average number of block reads. This meant that 'rubbish' bloat is added to the 'record'. I'll take the performance improvement over saving a tiny amount of the disk storage available.

                    1. Anonymous Coward
                      Anonymous Coward

                      Re: My code won't run but the spaces are great

                      @ Richard Plinston's reply to " Richard Plinston"

                      "Spaces aren't 'rubbish'", I never said that Space was rubbish meerly that redundant spaces are

                      "Also, most source code files on disk do have 'rubbish' filling" hardware platform assumption and since you brought Kbit up I call, "what about transmittion costs for capped data services" and "just because we used to do that do we still need to". You admit to padding your records to reduce the number of blocks you read however since the CPU performance has outstipped the hard disc for quite some time then using blockreads to justify your added bloat when compression would for any large set would destroy your arguement is living in the past and not in a good way.

                      My English spelling of an Indian name from a inconsequencial school project makes me a bad person? fair enough

                      "In my case it has been a deliberate choice" I presume that this is you saying that you are aware that you are adding bloat but "it is the way things are done" so it is okay not to bother seeking improvement via innovation or thought.

                      "I don't care that you made up your mind " clearly you disagree with my opinion that creating bloat is a bad thing even though you also said the opposite. I am getting used to your duality of thinking, clearly you missed your vocation in the religion of your choice.

                      To avoid redundancy and Microsoft bashing I will move to "My experience is different", you found when? your justification for additional bloat to your wares this is again based upon spining rust. Admittedly you are not alone, the storage manufactors are also optimising their products to accomodate the same assumptions and so we have a circle of redundancy when a little thought from software and hardware vendors could have finally removed your "necessary bloat" when storage moved to solidstate.

                      1. Richard Plinston Silver badge

                        Re: My code won't run but the spaces are great

                        > I never said that Space was rubbish meerly that redundant spaces are

                        The spaces that I use perform a particular function that I find superior to alternatives and are thus not 'redundant'. If you wish to operate in what I consider an inferior way then do that.

                        > "what about transmittion costs for capped data services"

                        There are tools that do compression and/or encoding for me when required. I don't try and second guess it.

                        > using blockreads to justify your added bloat when compression would for any large set would destroy your arguement is living in the past and not in a good way.

                        It was an argument that there may be other considerations to take into account rather than just following some dogma that you adopted on a BBC some decades ago, as you related. I constantly re-evaluate what gives me the best results. With databases I let them decide how to optimise.

                        > clearly you disagree with my opinion that creating bloat is a bad thing even though you also said the opposite.

                        It is called flexibility instead of having a fixed mindset that one solution fits all needs. The different 'solutions' were applied for different reasons with different tools.

                        > I am getting used to your duality of thinking, clearly you missed your vocation in the religion of your choice.

                        Religion is identified by having a particular unchanging dogma irrespective of any evidence, that seems to be you. 'Duality' is actually flexibility based on different or changing needs. You also are evangelising, another characteristics of a religion.

                        > I presume that this is you saying that you are aware that you are adding bloat but "it is the way things are done" so it is okay not to bother seeking improvement via innovation or thought.

                        It seems that it is you who have admitted to not seeking improvement since the 80s. You decided then that 'removing bloat' should be the top priority and it seems you haven't bothered to re-evaluate since. OTOH I have already given examples where 'bloat' gave an advantage and better tools avoided your objections.

                        1. Anonymous Coward
                          Anonymous Coward

                          Re: My code won't run but the spaces are great

                          @ Richard Plinston 2 posts up

                          I have actually read your posts and you use the tab key just as I do, where we differ in how that indent is actually stored in the file. The references to my trusty BEEB were that when I came across machines that did not store ASCII 9 as my IDE did but instead used multiple spaces then I felt this was a waste given that finding yourself halfway across the page to terminate a block was not unusual nor was having more characters in the indent than in the code on that line.

                          If the IDE can manage to keep track of how wide your indents are why does it need to store the spaces at all, surely the same process of storing the changes to indentation would be much more efficent. Ah but then it would not look the same on the text editor of my choice and my answer is why are you opening IDE files in a text editor, yes historically the language might have origonally used the text editor before anyone got around to creating an IDE but who still does for large projects.

                          You say efficency is irrelevant because it is everywhere in computing and attempting to get people to see it is useless, after all relative to the size of modern storage a few extra bytes here or there are meaningless. I agree that only changing this one item of waste on it's own is not enough but this is a thread read by people who program some of which are demanding that nothing changes, what better forum for getting some change away from the continuing acceptance that waste is reasonable or inevitable.

                          My mind set is actually that many programmers do not consider this waste an issue at all and whilst this has been a boon to storage manufacturers, perhaps it is time to look at the issue again, given that lots of people are using relatively smaller computers again.

                          Personally I think this is an ideal opportunity to get rid of the bloat mindset that has become a joke with some other operating systems. You seem to want to argue that what we have now is all there can ever be and I am suggesting that the evidence is against it, things have changed at lot over both our lifetimes and I would suggest they will continue to change further, hopefully for the better.

                2. Richard Plinston Silver badge

                  Re: My code won't run but the spaces are great

                  > Yes you can change the keyboard repeat rate but the whole point was to move the cursor to the correct position without waiting too long, if you slow it down then you might as well mash it instead or type it all and indent afterwards both bad in their way.

                  You appear to be confused. The 'keyboard repeat rate' has nothing to do with anything. _My_ tools do auto-indent, block indent, do the right thing when the tab key and back key are pressed.

                  Your comments show a complete non-understanding of how others work.

                  > You seem to be avoiding KB is this a hold out to the old byte being other than 8 bits arguement? you see we all carry around conventions from when we started.

                  I certainly do not 'carry conventions from when _I_ started'. I have often reviewed and revised my procedures over the years. Tab characters were useful on BBCs and CP/M and you seem to be locked into that mindset from the 80s, as you related.

                  1. Anonymous Coward
                    Anonymous Coward

                    Re: My code won't run but the spaces are great

                    "Your comments show a complete non-understanding of how others work." no, not work, worked. The original post being in reference to a system from the '80 where the difference between 2 bytes wasted per line of source could be significant those people not using equipment worth thousands. As to how a COBOL programmer works as I already said, COBOL is IMHO meh! this is not ignorance this is active disinterest

                    "I certainly do not 'carry conventions from when I started", and yet your actively avoid using KB for kilobytes where the 8 bit byte has been the standard storage unit for decades. Instead prefering Kb where the only modern references to multiples of bit units, I have seen, tend to be limited to ISP advertising. If we were tallking about paying for transmitting the bloat around then fair enough but this was a about storage costs.

                    Also you haven't explained why Gary Kildall is recognised as the developer of CPM and yet you claim in this thread to have developed it along with wordstar. Not co-developed, redeveloped or any other recognition of another developer's involvement, just you.

                    Your words:- "I developed complete systems on 64Kb machines (CP/M, Wordstar and others) without having to resort to compressing the code by having to use tab characters or shorter variable names or such (and it was COBOL)."

                    1. Richard Plinston Silver badge

                      Re: My code won't run but the spaces are great

                      > you claim in this thread to have developed it along with wordstar.

                      To any competent reader it would be obvious that "(CP/M, Wordstar and others)" was an attribute or qualifier of "machines". In English, and other languages, placement within the sentence is significant.

                      1. Anonymous Coward
                        Anonymous Coward

                        Re: My code won't run but the spaces are great

                        "To any competent reader it would be obvious that "(CP/M, Wordstar and others)" was an attribute or qualifier of "machines". In English, and other languages, placement within the sentence is significant."

                        okay I looked again at

                        "I developed complete systems on 64Kb machines (CP/M, Wordstar and others) without having to resort to compressing the code by having to use tab characters or shorter variable names or such (and it was COBOL)."

                        and concluded that "developed complete systems" where systems at that time included the hardware and then telling me the section in brackets was the hardware that you did not develop and then going on the say that your programmed in COBOL is where the confusion lies.

                        Were you trying to say that you wrote stuff in COBOL to run on CPM and others operating systems some of which integrated with wordstar? because that doesnt go with "developed complete systems" unless you definition of systems is more like package/suit/solution, you can't claim to have developed complete systems using someone elses code or hardware. The 8KB reference we have establisted elsewhere was irrelevant as support for you lack of optimisation, this as you were editing your source on disc rather than the trying to fit it into 8KB. The COBOL reference is also irrelevant, you could have written it in anything availible at the time so why mention it?

                        Whilst it is indeed in English it does seem to contradict itself even when you say that the bracketed section are hardware references. CPM and other machine fine, wordstar machine what is this are you saying you developed wordstar i.e. created it?

                        Still confused, please confirm exactly what you developed i.e. created yourself, that justifies "developed complete systems"

                  2. Anonymous Coward
                    Anonymous Coward

                    Re: My code won't run but the spaces are great

                    I will take the bait, can I ask what is with the underscore on self identification? is it that you really, really can't help yourself but add yet more bloat wherever you go?

                    1. Anonymous Coward
                      Anonymous Coward

                      Re: My code won't run but the spaces are great

                      Cor, multiple pissing contests going on in this thread!

                      1. Ken Moorhouse Silver badge

                        Re: Cor, multiple pissing contests going on in this thread!

                        There's those that use spaces.

                        There's those that use tabs.

                        Then there's those who bought Kernighan & Plauger's Software Tools who used utilities therein to convert between the two ("entab" and "detab"). If you got to the end of that book my guess is that you probably also enjoy the films of Éric Rohmer.

                        1. jake Silver badge

                          Re: Cor, multiple pissing contests going on in this thread!

                          And a couple years later, recreated in C as unexpand and expand and shipped with 3BSD ... the pair are still with us as part of the GNU toolset.

                          I still use that book occasionally when teaching. Éric Rohmer, not so much.

  20. Wiltshire

    Should it matter?

    No

    Does it matter?

    Yes. Woe betide any poor fool who absent-mindedly puts a tab in their Python code.

  21. heyrick Silver badge

    *Must* be spaces. When working with code you didn't write, you quickly grow tired of working out what the tab width is supposed to be to fix the code, and yet worse, code of vintage might have been passed through several editors arriving at different tab widths in the same file. Yuck.

    LOL at the suggestions to use Tab because mashing the Space key is a lot more effort. When I press Tab, the editor inserts exactly three spaces. No more, no less. Furthermore, using Delete on leading whitespace will back up by a Tab's width each time.

    1. nijam

      > When working with code you didn't write, you quickly grow tired of working out what the tab width is supposed to be

      No you don't . A tab is a tab. A load of spaces is some level of indent that you need to decode.

    2. Richard Plinston Silver badge

      > When I press Tab, the editor inserts exactly three spaces. No more, no less.

      Then you have very poor tools. When I press the tab key I get exactly to correct number of space characters required to get to the next tab stop. This may be 1, 2, 3 or 4 depending on the current position.

      With at least one editor I have I can set the tab stops individually to any required positions and then the number of spaces inserted can be any number that is required to get to the next one.

      1. heyrick Silver badge

        "Then you have very poor tools.

        Uh... It can be changed you know, including a mode where tab will line up with whatever is on the previous line.

        The two points were - firstly it doesn't matter how many spaces there may be, the code will look the same in every editor (unless you code using a proportionally spaced font!) as the space character is a known entity. Saying "tab is tab" is akin to "Brexit means Brexit" - what is it exactly? Two columns? Three? Four? Eight? It needs to be figured out if it was written in an editor at up didn't to the one you're using, and as I pointed out, I have seen older code written in different editors in its life where tabs meant different things in the same file.

        And secondly, the point was just because you prefer spaces doesn't mean you need to repeatedly type them. Any useful editor will permit the tab key to insert your preferred number of spaces, in my case that's three...

  22. MJI Silver badge

    2 environments I use

    One I prefer spaces and remove tabs ruthlessly. Much better to edit with spaces.

    Second tabs work so much better and tend to replace space indented if found.

    Depends on editor and/or IDE

  23. Anonymous Coward
    Anonymous Coward

    sigh

    you will follow the house norm for the product you are developing.

    As long as the indents are ACCURATE who cares.

    IDE will generally ensure accuracy.

    I do however suspect that the reason the space obsessed get paid more is because they have more grey hairs and still remember PUNCHCARDS (never even seen one, and you know who you are) or do all coding in VI, edlin or some other antique text editor, the next generation will catch you!

    I was forced to look after the complete antithesis where the code was all collapsed with no line breaks, no spaces, short variable names and was indeed a Hollywood style mass of characters and numerals. Now that requires skill to edit a real old school block of code.

    Overall, I am on the fence and I really is up to the editor, platform & software as to what it best, I do however prefer indents of either kind, to none at all. I am quite firm on this!

    1. Anonymous Coward
      Anonymous Coward

      Re: sigh

      "I was forced to look after the complete antithesis where the code was all collapsed with no line breaks, no spaces, short variable names and was indeed a Hollywood style mass of characters and numerals. Now that requires skill to edit a real old school block of code."

      Lemme guess. Tight RAM limit at the time, so the code was crammed. Wonder if it also had self-modifying code as well.

  24. Korev Silver badge
    Joke

    Python?

    Are Jupyter notebooks supposed to contain space or spaces?

  25. Shady

    Maybe...

    ... it just takes an additional 2.4 years to type all those extra spaces.

    No joke icon. Not joking. I'm a tabby.

  26. I ain't Spartacus Gold badge
    Trollface

    Missing information

    This research fails to say how much the coders get paid who indent their code with emojis...

    1. jake Silver badge

      Re: Missing information

      ITYM "how often the coders get fired" ...

  27. MJI Silver badge

    What about the important things?

    Vertical lining up

    Code MUST under threats of death to the minion have the following.

    Assignments over multiple rows.

    The := must be in the same column, they MUST line up, if the language/IDE (ancient version of VB I had to look at once) tries to stop it, create all variables with the same number of characters so they line up.

    Variable declarations, again columnar and MUST LINE UP UNDER PAIN OF DEATH.

    I hope I am not too extreme but I cannot stand wiggly code.

    1. DropBear Silver badge
      Trollface

      Re: What about the important things?

      So let me ask you - do you use comment blocks before functions, and if so, have you ever re-worded any just so a multi-line one lines up nicer on the far end...?

      1. Neil Barnes Silver badge

        Re: What about the important things?

        <multi-line comments>

        Doesn't everyone?

      2. Charles 9 Silver badge

        Re: What about the important things?

        "So let me ask you - do you use comment blocks before functions, and if so, have you ever re-worded any just so a multi-line one lines up nicer on the far end...?"

        Sometimes. Depends on how much of a discrepancy there is and if it's relatively easy to adjust that line.

      3. MJI Silver badge

        Re: What about the important things?

        Of course!

        1. Will Godfrey Silver badge
          Angel

          Re: What about the important things?

          No:- if the code below is beautifully crafted and instantly understandable.

          Sometimes:- if I think I understand the code but there just a nagging doubt.

          Always, and with loving attention, even to the extent of changing the wording just so the far end lines up perfectly:- if the code is an incomprehensible mess, and I've no idea what it does or what I can do about it.

    2. John Sanders
      Mushroom

      Re: What about the important things?

      I heard your call brother, we must stop the heresy!!!!

  28. TimNevins
    Meh

    Using tabs are only acceptable...

    ... when you're hacking into WOPR

  29. Nick Kew Silver badge
    WTF?

    Bad Surveys

    ObCrustyOldGit: Real Programmers don't waste bytes on spaces or tabs. Fancy layouts are for quiche-eaters. Unless your entire language is quiche (FORTRAN or Python).

    More seriously, an either/or question with no qualifiers? Don't most of us in reality just work with whatever convention happens to be in operation on a project? Even when we create an entirely new project, we'll do whatever seems right on the day, and maybe even allow the whims of a toolset-of-the-day to prevail in such unimportant matters!

    1. Loyal Commenter Silver badge

      Re: Bad Surveys

      ObCrustyOldGit: Real Programmers don't waste bytes on spaces or tabs. Fancy layouts are for quiche-eaters. Unless your entire language is quiche (FORTRAN or Python).

      Don't diss quiche. Made properly, it is basically a bacon and egg pie. And what, may I ask, is wrong with bacon, eggs, or pie?

      1. nijam

        Re: Bad Surveys

        > Made properly, it is basically a bacon and egg pie.

        It is *not* a pie! It is a flan.

        The use of </flan> in further discussion of the topic is deprecated.

        1. bombastic bob Silver badge
          Trollface

          Re: Bad Surveys

          (re: quiche)

          "It is *not* a pie! It is a flan."

          I killed a lot of Flan playing the Final Fantasy XIII series... not to mention "His Royal Ripeness" in FF13-2 (complete with a death-metal sounding leitmotif during the battle).

          obligatory reference to a book from the 80's, "Real men don't eat quiche". I suppose real programmers don't use C-pound. heh.

      2. Nick Kew Silver badge

        Re: Bad Surveys

        Don't diss quiche.

        Oh dear. I've nothing against quiche. It was a reference to "Real men don't eat quiche", which was once a bit of a cult, and spawned derivatives like things Real Programmers do/don't.

        I guess cultural references are always at risk of being lost in a heterogenous community.

        what, may I ask, is wrong with bacon, eggs, or pie

        That's easy. The conditions in which pigs and chickens are kept.

  30. Tweetiepooh

    We have 2 types of file we edit, in one the space/tab doesn't matter but in the other it needs tabs as a column delimiter. Guess what we don't do - convert tab to space - it's horrid trying to find why the code doesn't work and it's because the data file has some lines with spaces not tabs.

  31. tfewster Silver badge
    Alien

    You question my indentation?! I should kill you where you stand!

    Klingon developers do not believe in indentation - except perhaps in the skulls of their project managers

  32. Bronek Kozicki Silver badge
  33. Hans 1 Silver badge
    Pint

    It's Friday I'm in Love

    In the Space Bar where I go to, I usually leave the TAB to my colleagues.

  34. disgustedoftunbridgewells Silver badge

    Or: people who answer surveys about whether they use spaces or tabs are still children who earn fuck all?

  35. Thrud61
    Go

    Random correlation proven

    I used to use TAB all the time, but now 30 odd years later I only use spaces for indentation and I now earn 50 times what I did then.

  36. herman Silver badge

    ed is the standard UNIX editor

    $ man indent

    Name

    indent - changes the appearance of a C program by inserting or deleting whitespace.

  37. GrumpenKraut Silver badge
    Paris Hilton

    "error in line 123, colum 43"

    Now where is column 43 when tabs are used in that line?

    This alone is enough to abandon tabs.

    1. Loyal Commenter Silver badge

      Re: "error in line 123, colum 43"

      If you can't figure out the error by reading the whole line of code, your line of code is too long. Come to think of it, you're probably using linq.

    2. nijam

      Re: "error in line 123, colum 43"

      (a) If you can't spot the error given a line number...

      or

      (b) If you think the column number in an error message is trustworthy...

      ... you shouldn't be programming.

      1. Richard 12 Silver badge

        Re: "error in line 123, colum 43"

        Depends on context.

        The line and column are very useful error indicators when failing to parse a file in something like xml or json format.

        In languages like C or C++ that have a preprocessor, rather less so.

      2. Richard Plinston Silver badge

        Re: "error in line 123, colum 43"

        > (a) If you can't spot the error given a line number...

        Is that the line number before the preprocessor was run or after ?

  38. John70

    So by sound of it those with a higher salary using spaces need to take a pay cut since the IDE will do it for you when you press TAB.

  39. GeezaGaz

    website bombshell

    Totally pointless poll posted on (supposedly) interesting IT website

    Anyway what if your 'tab indent' is actually putting in spaces????

    Thats what Delphi always did/does

    1. John Sanders
      Trollface

      Re: website bombshell

      A bit autistic are we?

    2. Anonymous Coward
      Anonymous Coward

      Re: website bombshell

      Unless you leave a blank line for clarity at which point tab is your friend

  40. John Sanders
    Mushroom

    Tabs in code? heresy!!!!

    Cleanse the heresy:

    :set tabstop=<n> (2, 4, or 8, etc.)

    :set sw=<n>

    :set expandtab

    :retab

    1. Ramazan

      Re: :set tabstop=<n>

      too long, too many lines. Most people use smth like "set ts=8 et sw=4" and put it in modeline.

  41. Anonymous Coward
    Anonymous Coward

    The Real Surprise

    The median salaries given are much lower than I would have expected.

    1. Anonymous Coward
      Anonymous Coward

      Re: The Real Surprise

      They're about what I would expect for programmers who spend their time filling in pointless web surveys.

      Or replying to comments on The Register.

      1. Anonymous Coward
        Anonymous Coward

        Re: The Real Surprise

        "Or replying to comments on The Register."

        Oh, no. Paycuts for us both?

        1. Anonymous Coward
          Anonymous Coward

          Re: The Real Surprise

          "Oh, no. Paycuts for us both?"

          Only if our bosses find out.

  42. JavaJester

    C Requires Tabs?

    The C programming language has never required tabs, or even spaces for that matter as the Obfuscated C Code site http://www.ioccc.org/ demonstrates.

  43. ecofeco Silver badge
    WTF?

    Wait. What? HOW much?!

    Most devs make less than 60K?

    What... what happened?!

    1. Anonymous Coward
      Anonymous Coward

      Re: Wait. What? HOW much?!

      Exactly. What is given as the median, I would expect to be the bottom of the scale: entry level.

  44. hellwig Silver badge

    It's not the character, it's the font.

    I uses spaces, but I use a font that sets spaces to 1.3 times the regular mono-space width. I like to live dangerously.

  45. wolfetone Silver badge

    People who use tabs are efficient, because we're not swinging the lead like our comrades who take the piss and press the spacebar 4 times instead of a tab.

    You should all be very ashamed of yourselves!

    1. stephanh Silver badge

      efficiency to ∞+1

      I used to solve that by indenting with 1 space.

      Then I wisened up and now I don't indent at all. Beat that for efficiency, tab user!

      It also makes for quite interesting Python code.

    2. Anonymous Coward
      Anonymous Coward

      You should all be very ashamed of yourselves!

      I am - but use of the space bar is pretty far down on the list of reasons why.

    3. Richard 12 Silver badge

      I set up my IDE with the house style and let it do it all for me.

      There seem to lot of people manually indenting. Weird.

  46. Howard Hanek Bronze badge
    Happy

    Or

    ....it could be just better hygiene habits.....

  47. stephanh Silver badge

    competitive advantage

    I will start my own software company and strictly mandate the use of tabs.

    Thereby I can pay my programmers 8.6% less and undercut the competition.

  48. Aladdin Sane Silver badge

    Spaces

    Yes, but should it be, 2, 3, 4 or something weird?

  49. rnturn

    Pay hike imminent!

    I've just finished going through all my source code and issued "M-X untabify". Now I'm going to kick back and wait for my salary bump. (Hope the boss isn't a vi bigot.)

  50. GrapeBunch Bronze badge

    Wend

    I wonder if, the more experience you have with documents (i.e., the older you are), the more likely you are to prefer spaces in programming? I wonder if the survey was corrected for age of respondents, with the idea that the older you are, the more you're likely to be paid.

    I use Allman, but the code I usually write doesn't have braces. Were I programming in a brace-y language, I'd probably prefer Pico. According to the wiki article Indent_Style. Whitespace makes me feel vaguely uneasy, like wasting paper. I like to see it all on one sheet / screen. Still neatly formatted, mind you, no 4K-ROM cassette BASIC blockiness.

  51. thosrtanner

    Clearly the people writing go are doing bad things to their earning power.

    Fortunately for my salary I abhor tabs, and after reading that, I shall never write in it.

  52. Ken Moorhouse Silver badge

    If this were to do with the number of spaces...

    ...used by one coder, and the number of spaces used by another coder, then I can see how it would relate to quality, and hopefully then salary.

    Using less spaces either means:-

    * That the programmer is putting code into procedures rather than having lots of nesting, which increases the overall number of spaces used

    * Or the programmer uses no indenting at all. I suspect programmers that don't use any formatting aren't likely to write long programs, so if an automated leading space count were carried out on a typical programmer's output then (all other things being equal) the ratio should be fairly indicative of the quality of code contained therein.

    (45 years of coding experience: started off with systems that printed out on wide music rule paper - however IIRC the GEC 4080 only allowed about 80 columns of that to be used)

    1. h4rm0ny
      Headmaster

      Re: If this were to do with the number of spaces...

      >>"Using less spaces either means:-"

      Fewer spaces.

  53. disgruntled yank Silver badge

    There's a Stob for that

    There was a Verity Stob bit years ago, in which the narrator loathed a co-worker on various grounds, notably on the ground that he used tabs rather than spaces.

  54. John Savard Silver badge

    Illegal Characters

    I don't know about the computers you use, but just try and put a card with a 12-5-9 punch in it in a FORTRAN IV deck, and see what happens!

    I realize these newfangled C compilers running under that Unix operating system recognize the ASCII control character "tab" as a form of whitespace, but this has not always been the case historically.

    Even at the present time, if one has code with embedded tab characters, one has to be sure that the text editor one uses with such code has been told to present a tab as the right number of spaces so that the code will look normal. Naturally, of course, that is not a problem if one only ever uses the Integrated Development Environment (IDE) that came with the compiler, or some third-party one specifically intended for such use.

    Come to think of this, the pay disparity may be explained by this. Programmers fresh out of school, who use only the software that holds their hands while they program, are paid less than the crusty old veterans who adopt conservative practices that will allow them to get work done even if all they have is a command line or a card punch!

  55. FIA

    32 > 9.

    'Nuff said.

  56. Philip Stott

    Obviously no professional programmers in blighty were included in the survey - who'd get out of bed for $60K FFS :-P

    1. Anonymous Coward
      Anonymous Coward

      I'm guessing India. $60k is considered entry level pay for most CS graduates in the US as well. Or maybe there's more untrained "programmers" out there then we'd like to think.

  57. Charles Calthrop

    sometimes i use tabs, sometimes i use spaces

    i do not give a fuck

  58. Anonymous Coward
    Anonymous Coward

    Use tabs when being unfortunate enough to have work in a holy war of Visual Studio and Accurev source control and watch things have a shit fit when one tool decides to replace spaces with tabs or vice-versa in multi-lingual utf8 resx files containing e.g. Chinese text or SQL script files containing one stored procedure that can run to hundreds of lines of SQL statements long due in absolutely no discernible pattern approximating readability which I can only attribute to an institutional innate hatred of readable maintainable code.

    Later it gets even funnier when you encounter a code conflict in said mangled text files and you can't make sense of what the fuck goes where in the blindingly stupid Accurev merge mangler. Sometimes I just want to fucking die and other times I think I'm already dead and in hell.

  59. kmac499

    That's what IDE add-ins are for .

    Every time I takeover a new chunk of code, I run it through my favourite formatter.. and all of a sudden the code is visible, even if not readable and understandable.

    Now we've nailed this one down and peace reigns, can we discuss variable naming and camel case ...

  60. Grunchy

    Tabs and spaces are for BABBIES. You don't "need" any of that overhead. Oh right, this is the internet. Ok then, *I* do not need any of that overhead. *You* who need spaces & tabs also need gentle words of support from your MAMAs.

    No matter which you use, the compiler summarily ignores all that extraneous trash.

    1. Anonymous Coward
      Anonymous Coward

      Ok Grandpa, time for your nap now.

      The compiler is happy to use whitespace as a token deliminator. The difference between intvariable and int variable is pretty important.

      BTW, what are "babbies"?

  61. JLV Silver badge
    Trollface

    Sheesh, no wonder no world peace...

    If we're still having religious wars over stuff like this?

    Do whatever your project/employer/language mandates. Or whatever _you_ like. Let the others do what they like/have to. Problem solved.

    Next - programmers using Vim outearn Emacs. Or not.

  62. J.G.Harston Silver badge

    Earn more, or are paid more? If they are paid per character, then yes, they earn more, but earn!=paid.

    1. heyrick Silver badge

      earn!=paid

      "Earn" is the nice figure that is dangled like the proverbial carrot.

      "Paid" is what you end up with after all the many deductions.

  63. Anonymous Coward
    Anonymous Coward

    Inaccurate

    This data isn't accurate, people who use spaces tend to be the ones who care more about something so trivial. They also tend to be the ones who fill out surveys. Meanwhile people using tabs are busy getting the job done.

  64. Milky_cow

    "tabs take fewer keystrokes"

    U wot mate, my .vimrc begs to differ.

  65. cutterman
    FAIL

    I use tabs. But NotePad++ lets me configure whether it is going to do a true tab or 3 spaces (or 4 or 10 or whatever).

    If my employer wants tabs they get tabs, if they want 6 spaces they get 6 spaces. Big deal.

  66. Uplink

    Code-aware editor and diffs would be nice

    I would love if we could take a step into the future and edit code however the heck we like.

    I would like the editor to have a "presentation" mode where it shows the code as I want it formatted, and a "storage" mode where the code is saved in a standardised format.

    I would like diff tools to ignore white space changes while also taking into account rescoping of blocks of code. E.g. I indent a block to b included in a for loop. I'd like the diff to show the block with its new indentation but only tell me that the surrounding for loop was added, not that all of it was deleted and replaced with th same code and some extra indentation.

    The stored code could even be in a format that is hard to edit with vim and is not comparable with diff - as long as the language-specific editor does the above right.

    1. Richard Plinston Silver badge

      Re: Code-aware editor and diffs would be nice

      > I would like diff tools to ignore white space changes while also taking into account rescoping of blocks of code. E.g. I indent a block to b included in a for loop. I'd like the diff to show the block with its new indentation but only tell me that the surrounding for loop was added, not that all of it was deleted and replaced with th same code and some extra indentation.

      man diff

      -E --ignore-tab-expansion

      Ignore changes due to tab expansion.

      -b --ignore-space-change

      Ignore changes in the amount of white space.

      -w --ignore-all-space

      Ignore all white space.

      -B --ignore-blank-lines

      Ignore changes whose lines are all blank.

      -I RE --ignore-matching-lines=RE

      Ignore changes whose lines all match RE.

      --strip-trailing-cr

      Strip trailing carriage return on input.

      etc

      1. Uplink

        Re: Code-aware editor and diffs would be nice

        I do use 'diff -w' when I want to look at a diff that has a block with changed indentation, but if I removed a line that line is shown with its original indentation. A tool that can detect indentation changes could show the deleted line in the context of the changed indentation so my eyes don't go off the rails when those deleted lines are encountered - especially if there's a lot of missing context because the deleted line and the indented context are far apart.

        1. Richard Plinston Silver badge

          Re: Code-aware editor and diffs would be nice

          > I do use 'diff -w'

          I find that diffuse can be useful for identifying important changes while catering for ignoring irrelevant.

    2. heyrick Silver badge

      Re: Code-aware editor and diffs would be nice

      "I would like the editor to have a "presentation" mode where it shows the code as I want it formatted

      That would be lovely. No more fretting over the insane and incorrect things people do with the curly braces...

  67. Zmodem

    coding is boring enough without having to press a button 6 times over 1

    all those extra 5 seconds adds upto hours over a week of coders not working

    1. jake Silver badge
      Pint

      @miscellaneous

      Zmodem: So tell your system that pressing the TAB key once inserts the appropriate number of spaces from the cursor position to the next tab stop. It ain't exactly rocket science; vi and EMACS have had this capability for decades.

      Uplink: You are a coder. It's open source. Quit whining about it and make it possible.

      Plinston: I read it that you were claiming to have developed CP/M and Wordstar using COBOL too. After doing a double-take, I figured just clumsy use of English ... Gawd/ess knows I've made similar mistakes over the years.

      Plinston & assorted AC hangers-on: If all y'all were really interested in reducing bloat, you'd rent a room and get the inevitable over with.

      AC: The bloat in _emphasis_ or *emphasis* or other variations on the theme is quite a bit less than the bloat in emphasis. And yes, even in a forum like this it could be considered bloat. If you're being pedantic for the sake of being pedantic.

      Everybody: This round's on me, thanks for the entertainment :-)

      1. Uplink

        Re: @miscellaneous

        "It's open source. Quit whining about it and make it possible."

        Absolutely - if I had the skills for text integrated with language parsers. Alas, I do not. I fail miserably at that particular topic. I do have something else in mind*, and if I ever get it to MVP stage I'll come here to brag about it.

        *What do I have in mind? Something "data-first" based on my need at one point to DRY up my development process regarding data structure design in Symfony with Doctrine while using Doctrine Migrations. I currently suck at GUI and I'll have to get over that hurdle before I can even make an interactive mockup in a browser. It's a steep learning curve (for me), but it will click at some point like every other steep learning curve did before.

    2. Richard Plinston Silver badge

      > coding is boring enough without having to press a button 6 times over 1

      If you believe that is ever necessary then get better tools or learn how to configure the ones that you have.

  68. david 12 Bronze badge

    Left handed touch-typist

    So keys under the RH little finger are annoying for me. Including the ubiquitous {} keys.

    And I absolutely understand why Right-Hand coders would not have made the connection to why they think that the tab is <just wrong and stupid>.

    1. jake Silver badge

      Re: Left handed touch-typist

      So re-map your keyboard to something more pleasing for you.

    2. Richard Plinston Silver badge

      Re: Left handed touch-typist

      > why they think that the tab is <just wrong and stupid>.

      Please qualify whether you are referring to the 'tab key' or the 'tab character', or is it the general concept of 'tabulating'.

      1. TRT Silver badge

        Re: Left handed touch-typist

        Diet tab. Unless you need the sugar rush.

  69. Bitbeisser

    It's f**king white space, either way, so who cares?

    Oh wait, you are one of those who program in an excuse of a programming language that makes white space significant...

    1. jake Silver badge

      Who cares?

      The next coder who has to finish/fix/maintain/port your shitty, badly commented source code, just for a start ...

  70. malvcr

    Personal profile

    James Coplien already evaluated the space role in good source code 19 years ago. Take some time for a good reading.

    https://people.cs.pitt.edu/~chang/budha/coplien.htm

    What I think is that the issue has to be with the programmers personal character and professional profile.

    In general (important to declare that there are exceptions), the people that care enough to use spaces, because has total control on how the source code will looks for everybody, it is also careful enough to create better quality source code that has less failures and accomplish better with the final goals. So, this is more effective people that can resolve better the computing problems, that it is more attractive to employers and that could have better professional positions.

  71. oneguycoding

    Old skool

    Always insisted on using tabs because of disk space issues back in the day, this whole thing is very disturbing though.

  72. cortland

    it may be

    It may be they _do more code and make more money_ (heh) because spaces are faster. and it's easier to avoid errors using them than tabs due to the large space bar and more accurate placement of typing digits.

    Still, I can't justify the reported income discrepancy to typing speed alone; did e. e. cummings earn more eschewing upper case?

  73. MangyDog

    What about us coders who if they can be arsed to remember to indent use tabs, but later just auto indent there code anyway from the IDE tools? :p

  74. Dallas IT

    Dear Space-morons,

    Tabs are obviously superior in every way to spaces. They line up perfectly and require ONE press to add (in any IDE or editor), as opposed to tapping the spacebar like a rat in a lab experiment. Hey, maybe I'm onto something insightful about you space invaders...

    1. Anonymous Coward
      Anonymous Coward

      @ Dallas IT

      > Dear Space-morons,

      > Tabs are obviously superior in every way to spaces. They line up perfectly and require ONE press to add (in any IDE or editor), as opposed to tapping the spacebar like a rat in a lab experiment.

      You have just confirmed a couple of reasons why the article is correct about 'tab character users' (as distinct from 'tab key users') deserving lower pay scales than others:

      1. You are unnecessarily abusive.

      2. You are under-educated in configuring and using the tools that you purport to use.

      I suggest that you stick with investigating space invaders, it seems that it is a better match for your skill set.

  75. Anonymous Coward
    Anonymous Coward

    what if it is automated?

    So, if I have Eclipse set up so that when I type "tab" it automatically indents the correct number of spaces (3 in the project I work on), which way should I have answered that question?

    Of course, maybe there should've been a third answer, "I configure my editor to just do the right thing." That would probably correlate to an even higher salary than the choices. :)

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019