back to article Microsoft veteran ditches Team Tabs, blaming storage trauma of yesteryear

Veteran Microsoft engineer Larry Osterman is the latest to throw his hat into the "tabs versus spaces" ring. The debate has vexed engineers for decades – is it best to indent code with tabs or spaces? Osterman, a four-decade veteran of Microsoft, was Team Tabs when storage was tight, but has since become Team Spaces with the …

  1. wolfetone Silver badge

    "The nightmare scenario is where developers have mixed tabs and spaces in the same source code file, creating a mess that has the potential to be indecipherable by whoever has to maintain it in the future."

    That isn't the fault of spaces, that isn't the fault of tabs. It's the fault of a coder who thinks they know best.

    1. steelpillow Silver badge
      Trollface

      Re: where developers have mixed tabs and spaces

      Or several coders who think they know best, but disagree.

      But hey, you mean there are source files where this doesn't happen? Like everything else in the world, it's a mess and you have to just deal with it. Purists should be left to eat flamebait (he says, posting some just for the lulz).

    2. Anonymous Coward
      Anonymous Coward

      > It's the fault of a coder

      It's the fault of the language. Spacing is used to split blocks of code, or is it?

      1. Version 1.0 Silver badge
        Pint

        "The significant problems we face cannot be solved at the same level of thinking we were at when we created them." - Albert Einstein.

        An excellent example of the so much better thoughts from a genius - being aware of their original (years ago) thoughts can be very helpful for everyone these days. You can learn a lot by reading the original thoughts of Albert Einstein that often mention the way we are thinking today. He said the quote I just listed years ago but remember that "Time is an Illusion"

        1. Evil Auditor Silver badge
          Joke

          And he said "thou shall use spaces"

          1. Bill Gray

            Hang on, I thought it was Winston Churchill who said not to use spaces?

          2. steelpillow Silver badge

            No no no! Einstein said "thou shalt use spacetime" Anybody still coding in spaces is still living in the Newtonian era. Drop a few Tabs and you'll soon open up to the new experience!

  2. Dan 55 Silver badge

    Is it a really a problem?

    "Thou shall use four spaces per indentation, and an indentation shall be four spaces."

    And then if you wanted to line things up nicely to aid readability then the remainder is done using spaces.

    1. FrogsAndChips Silver badge

      Re: Is it a really a problem?

      Five is right out.

      1. StewartWhite
        Joke

        Re: Is it a really a problem?

        "Four shalt thou not count, nor either count thou two, excepting that thou then proceed to three. Five is right out. Once the number three, being the third number, be reached, then lobbest thou thy Holy Hand Grenade of Antioch towards thy foe, who, being naughty in My sight, shall snuff it."

  3. Jim Willsher

    Tabs. Always tabs. It's very easy to see indentation differences when it's 1 tab, 2 tabs or 3 tabs. But when you use spaces, the intention to use 4 spaces, 8 spaces or 12 spaces invariably ends up being 3, 5, 9, 11, 13 etc.

    Also, if you then want to add another IF condition within a while loop within another while loop, what's quicker - tab tab tab or space space space space space space space space space space space space?

    Tabs all the way.

    This isn't about storage any more, however code readability shouldn't suffer.

    NB I'm assuming four spaces is the chosen number; any less and it's hard to work out what's what.

    1. Lee D Silver badge

      Tabs all the way... just standardise how many spaces = 1 tab, it's really not difficult and that's the cause of 99% of problems.

      Personally, I hate any editor that distinguishes and compilers shouldn't care one bit. The nonsense with Makefiles and other indentation-dependent languages is so ridiculous that it's laughable it still survives in the modern age.

      Hell, if you must, insist that pressing Tab literally inserts 4 spaces into the document.... I'm happy with that as a compromise.

      But don't say I *can't* use a Tab key and *must* type in 4 individual spaces for every indent level in a large codebase.

      1. hittitezombie

        One word: Python

        White-space-separated languages are stupid.

        1. bemusedHorseman

          Re: One word: Python

          Technically, the Python spec allows either, as long as you use one and only one indentation method in a given file. Mix them up, and the interpreter (rightfully) commits kill-dash-nine.

          1. Anonymous Coward
            Anonymous Coward

            Re: One word: Python

            so it's fucking stupid both ways

            1. ritmo2k

              Re: One word: Python

              How did that pass the censors?

        2. Anonymous Coward
          Anonymous Coward

          Re: One word: Python

          > White-space-separated languages are stupid.

          Thus speaks someone who hasn't had to deal with literally randomly indented PL/SQL and is not allowed to use a formatter "because that will break source code control"

        3. LVPC

          Re: One word: Python

          >> White-space-separated languages are stupid.

          Well, most written languages are white space, plus tabs count as white space to compilers, but yes, python making the number of leading spaces significant is stupid.

        4. This post has been deleted by its author

        5. imanidiot Silver badge

          Re: One word: Python

          Indeed, it's one of the reasons I really don't like python.

          Whitespace and indenting is there for one purpose and one purpose alone. Making it a requirement for the language/interpreter/compiler is stupid.

      2. Matt Dainty

        Silicon Valley covered this: https://youtu.be/V7PLxL8jIl8

      3. Rich 2 Silver badge

        I completely agree with your point about makefiles requiring tabs. It IS archaic and really really annoying

    2. richardcox13

      > tab tab tab

      Is indeed quicker, which is why any text editor that is worth the CPU/Memory/... to run will automatically insert the correct number of spaces (including less than four if there is already a character or more in place. And auto-indent the next line to match (use shift-tab to reduce indent). A serious editor (eg. what you should be using if paid to write code) will support an editorconfig file in the repo so the team shares settings and does not depend on everyone configuring their editors the same.

      If your standard editor cannot do this, then PEBCAK.

    3. Anonymous Coward
      Anonymous Coward

      I'd love to go full tabs. I have a few colleagues who push hard for 100% spaces and 2 spaces for an indent. It's a nightmare.

      1. Dan 55 Silver badge

        Everyone knows you never go full tabs.

      2. Richard 12 Silver badge

        Space on screen is more valuable than space on disk.

        2 spaces indent is plenty. 1 would be sufficient. More stuff fits horizontally.

        The problem is that it's exceedingly difficult to get consistent on-screen size of <tab>, yet trivial to get a consistent size of <space>.

        Therefore, tabs must not be used.

        1. JoeCool Silver badge

          4k 32" monitor $400

          and that fills your field of view, so no - screen space is not an issue. If it is, your functions are too long!

          1. Anonymous Coward
            Anonymous Coward

            Re: 4k 32" monitor $400

            so don't write your function all on one line.

            or if using fucking python, go learn a proper language

            1. ritmo2k

              Re: 4k 32" monitor $400

              I must know the secret to escape the censorship regime.

              1. Anonymous Coward
                Anonymous Coward

                Re: 4k 32" monitor $400

                you do know this isn't a fucking kiddie forum? (and no not the sort of kiddie fiddlers sharing vile crap on xhitter without musk stopping it!)

              2. Evil Auditor Silver badge
                Joke

                Re: 4k 32" monitor $400

                It's not a secret: once you've acquired a certain badge, you're granted a quota of mild swearwords.

                1. Aladdin Sane

                  Re: 4k 32" monitor $400

                  I think I've used several people's quotas.

          2. This post has been deleted by its author

        2. AJ MacLeod

          It's exceedingly trivial to get the desired size of tabs, any usable editor can be configured to display them any size you like. The whole purpose of tabs is to aid with aligning things consistently - spaces should be mere separators between words and if they were sufficient tabs would never have been invented...

          1. Richard 12 Silver badge

            "Aligning things consistently"is fundamentally incompatible with "any size you like"

            That's the entirety of the problem with tabs.

            We're not sole developers anymore.

        3. nijam Silver badge

          > The problem is that it's exceedingly difficult to get consistent on-screen size of <tab>, yet trivial to get a consistent size of <space>.

          No, the exact opposite is observably the case.

        4. LVPC

          We are no longer in the dark ages of 80 column screen width. Use the for indentation, and set your editor to display tabs as whatever number of spaces floats your boat. Problem solved.

    4. Rich 2 Silver badge

      “space space space space space space space space space space space space”

      Well, no.

      Most editors used for coding can be configured to use “soft tabs” so 1 press of the tab key will insert N number of spaces, aligned neatly on tab column. After 30 (50?) or so years of this feature being about in many editors, I really shouldn’t expect to have to explain it.

      As for real tabs. No. Just no. Not least because if you want to align some text that’s not on a tab boundary you end up with a mixture of tabs and spaces which has already been highlighted as an abhorrence. Using tabs has no discernible advantage today and hasn’t done for many years

      1. LVPC
        Happy

        If you're only using leading tabs to align text, you'll never end up with text non-aligned. Tab FTW.

        1. doublelayer Silver badge

          It depends how you like your code indented. If, for example, you want a multiline function call to line up the first letter of the second line with the parenthesis of the function call, or in some cases the first character after that parenthesis, then that parenthesis might not be on a tab boundary. My solution to this is to not align that letter and that parenthesis, and I'm using spaces. I just can't be bothered. However, there are people who want those things aligned and if they get their way, then spaces are the only option for doing it.

          1. Anonymous Coward
            Anonymous Coward

            they are fucking idiots then as the function name length wold then come into play!

            1. Rich 2 Silver badge

              It has absolutely nothing to do with the function name length.

              Now who’s the “fucking idiot”?

              1. doublelayer Silver badge

                It partially has to do with the function name length, as well as anything else that might be on the line. For example, if line one reads

                char *data = someFunction(

                then there are people who would like the continuation line to be indented by 26 or 27 more spaces than that line. I am not one of those people, and in fact lining these up is annoying enough that I tend not to adhere to their style unless required, but I've seen people ask for it.

              2. Anonymous Coward
                Anonymous Coward

                if you don't understand how the char len of the function name before the ( or {

                isn't relevant then your the fucking idiot.

                as an example:

                String thefuckingidiot () {

                return "you";

                }

                String notthefuckingidiot () {

                return "me";

                }

                see how that works!

      2. Anonymous Coward
        Anonymous Coward

        Do most editors also remove N spaces on hitting delete? They don't. So you have to spam or hold and aim delete to get them removed again or do some finger gymnastics going shift pos1.

        1. PerlyKing
          Trollface

          Solution: find an editor that can do this. I recommend Emacs ;-P

          1. Freddie

            You misspelt "vim" ;)

            1. PerlyKing
              Mushroom

              And so it begins :-D

        2. OhForF' Silver badge

          Most modern editors have an undo function that will remove all N spaces the previous soft tab inserted in one step when you pree CTRL-Z or whatever shortcut you set the undo function to.

          Not really an important point IMHO as typing speed is not the limiting factor when i program. I can type faster than i can think of what the code should be.

        3. Rich 2 Silver badge

          “Do most editors…”

          Again, if you use a decent editor you can almost certainly get it to do this

    5. Bill Gray

      The differences in "what a tab" means have obviously caused far too much grief. A modest proposal : add the following character points to Unicode :

      U+something or other = TAB EXPANDING TO TWO SPACES

      U+next value = TAB EXPANDING TO THREE SPACES

      U+next value = TAB EXPANDING TO FOUR SPACES

      ... up to, say, TAB EXPANDING TO TWELVE SPACES (should be enough for anybody). Tab users can continue to tab, with their intent recorded along with the tab.

      (I shouldn't have to point out that the above is not intended seriously. But it occurs to me that, given some of the loopy emoji already in Unicode, there might be a risk that the Unicode consortium itself might take this seriously... (shudders))

      NB I'm assuming four spaces is the chosen number

      Well, as has been inevitably noted above, five is right out.

      1. imanidiot Silver badge

        I wouldn't really link a special new character to tabs or spaces but what would actually work would be a character set that simply defines: Indent one level, indent 2 levels, indent 3 levels, etc, and let the editor deal with how much indenting the programmer actually wants to see. Because at the end of the day indenting only exists to make things readable for the human (Or it should anyway *cough* friggin' python *cough*)

    6. An_Old_Dog Silver badge
      Joke

      If You're Unhappy Now with the Tabs/Spaces War, Just Wait

      The Kernighan and Plauger book, Software Tools, contains (among other things) two short, simple programs: entab and detab. If you're living in Unix- or Linux-land, there's tr.

      Just wait till some rat-bastard uses one of them to replace leading spaces with \0xFF (which in the IBM PC character set, looks just like a blank) in your codebase!

  4. steelpillow Silver badge
    Coat

    What I don't understand

    is why code editors don't just go, "do you want tabs or spaces?", get on with prettying it up for you, and offer the option of stripping it all out anyway when you save out.

    I mean, if Notepad had that option, I'd never use anything else.

    1. Lee D Silver badge

      Re: What I don't understand

      Eclipse always used to, I don't know if it still does.

      The Coding Style (or whatever it was called) tab on Eclipse was one of the best formatters/linters I know, and would operate as-you-typed as well as allow you to just "format all" (in essence, though I forget the procedure to do that now).

      1. LVPC

        Re: What I don't understand

        The problem with eclipse is that as it's gotten bigger, it's gotten slower, to the point that even this year's New build pc offs stalls when typing. Too bad, using other tools instead, probably going to delete it permanently because it will never get better if last performance degradation is any guide.

    2. richardcox13

      Re: What I don't understand

      If your editor cannot do this natively there may well be an extension to do it.

    3. Richard 12 Silver badge

      Re: What I don't understand

      They do.

      The trouble is that some people refuse to use the tools.

      git even has pre-commit and post-checkout rules that could be used to enforce tabs on your end and spaces on mine.

      If you could only agree on how big a <tab> is, anyway.

      1. AJ MacLeod

        Re: What I don't understand

        Come on, think about this for a minute. NOBODY needs to agree on how big a <tab> is - that's the beauty of them! All that matters is that one tab is one level of indentation, two tabs are two levels of indentation. If you like your indents to be the size of one space, that's fine; configure your editor to display that and use tabs. When I have to look at your file it'll look as perfect to me as it does to you, as my editor is set to display tabs the way I like them. Everyone wins. I genuinely don't understand why people find this so hard to grasp...

        1. Lee D Silver badge

          Re: What I don't understand

          Because when you then get a guy taking code that was lined up with tabs and adds lines lined up with spaces, they won't match and now your indentation is broken or misleading (there are even gcc warnings for misleading indentation like that, which can cause compiled failures if you compile with -Werror for example, and thus could literally stop the build succeeding).

          And don't even imagine what happens when the same guy takes that same tabbed-line, adds a weird number of spaces to the tab, and now you have a mixed line that doesn't correspond to any amount of tabs for conversion.

          1. Anonymous Coward
            Anonymous Coward

            Re: What I don't understand

            that's why languages should use {} not fucking white space.

            Then you can fix the indentation however you fucking like it and not end up with fucked up code.

            1. Gene Cash Silver badge

              Re: What I don't understand

              Doing the indentation however you fucking like is the root of the problem. I have everyone doing that around here, and the code is unreadable.

              A language with whitespace enforces "stop banging away at the keyboard like a 4 year old and be an adult with standards"

              1. Michael Strorm Silver badge

                Re: What I don't understand

                On the contrary, languages that make whitespace/indentation syntactically significant still require you to "bang away at the keyboard" (*), they just force you to do it in the exact way *they* expect.

                And yes, having that enforced restriction might solve the problem of those incapable of indenting consistently and cleanly without it. But then, wouldn't the entire problem there that such people *aren't* "adults" capable of maintaining standards on their own and require the language to force them to do so?

                (*) Unless the editor handles that for you, which would apply in either case, regardless.

          2. LVPC

            Re: What I don't understand

            So use a script to convert any amount of leading spaces to the equivalent number organs at the rate of 1-8 leading spaces =1 tab.

            1. Evil Auditor Silver badge
              Thumb Up

              Re: What I don't understand

              ...and bring the guy who messed it up to the stake. After tar and feather treatment. And breaking them on the wheel.

    4. James Dore

      Re: What I don't understand

      The Indentation panel of Kate offers exactly this kind of functionality.

    5. Rich 2 Silver badge

      Re: What I don't understand

      “…. get on with prettying it up for you, and offer the option of stripping it all out anyway when you save out”

      What editor are you using? Anything decent (eg - vim, eMacs, <insert editor of choice here>) will usually have a feature to do whatever formatting you want on save. Or load. Or any time you like. And if it’s not built in, said decent editor probably has a plug-in system that can provide such functionality.

      Personally, I hate auto-formatters because they never do 100% what I want. But the option is there if you want it

  5. Doctor Syntax Silver badge

    Tabs. Life's too short to peel grapes and count spaces.

    1. Neil Barnes Silver badge
      Headmaster

      And the point that no-one's mentioned: tabs are quicker and more exact to go backwards over. All very well if the editor replaces tabs with spaces, but will it take (e.g.) four spaces at a time away?

      1. Gene Cash Silver badge

        EMACS does.

        1. Neil Barnes Silver badge

          Somehow I am not surprised. But in my nearly fifty years of playing with computers, I've never actually met EMACS in the wild.

          1. Anonymous Coward
            Anonymous Coward

            You did not try hard enough !!!

            It is out there and lives still in the dark and dusty corners of the universe.<jk>

            [Must not annoy the EMACS gods as they are vengeful and do not forget !!!]

            :)

      2. Freddie

        Yes. Get a decent text editor - if you're editing text all day then you deserve that, at least.

    2. David Hicklin Silver badge

      I have notepad++ set up so that a tab key press inserts 4 spaces (and shift tab removes 4)

      Best of both worlds

  6. Anonymous Coward
    Anonymous Coward

    Does it matter?

    It isn't too difficult to run source code through a a filter to convert to and from tabs and spaces or, more intelligently, ingest the source code into an (annotated) abstract syntax tree and emit a canonically formatted version of that code.

    The venerable C code formatter indent does a pretty decent job and doesn't actually grok C syntax.

    Syntactically white space should be white space but historically various syslog.conf and Makefile implementations have begged to differ.

    At least on this vi and emacs agree in seemingly allowing most common indentation variations.

    One peculiar and confusing situation was looking at C code in a terminal window stuck on a proportional typeface - ugly enough but oddly the tabbed indents aligned but the spaced indents didn't.

    1. DanielsLateToTheParty

      Re: Does it matter?

      Or there is "expand" and "unexpand" on Linux. Put them in git hooks as you please and we can all forget this nonsense.

    2. Anonymous Coward
      Anonymous Coward

      Re: Does it matter?

      The python wonk's would have a fucking fit!

      it would turn their code into worse garbage than it already is!

    3. nijam Silver badge

      Re: Does it matter?

      > ...but oddly the tabbed indents aligned but the spaced indents didn't.

      Surely that's exactly what you'd expect.

  7. Blue Shirt Guy

    Confusing teams

    I can't help but feel the title is of this article is a bit click baity to get people thinking it's about Microsoft Teams and not something totally unrelated.

    Anyway when it comes to tabs and spaces all I care about is that whatever language I'm using doesn't do something batshit insane and try to make them part of the syntax. I'm looking at you Python.*

    *From the distance of a very very long barge pole.

    1. Dan 55 Silver badge
      Trollface

      Re: Confusing teams

      Microsoft Teams was definitely written using spaces to indent.

      1. Richard 12 Silver badge

        Re: Confusing teams

        Nah, it's had all the whitespace removed entirely.

      2. katrinab Silver badge
        Alert

        Re: Confusing teams

        Teams is written in Javascript/Electron, therefore has far bigger problems than indentation styles, like the 70,000 dependency files you need to import just to do a hello world.

  8. PCScreenOnly

    Font / editor

    If the IDE is using a fixed font, I don't mind either but if it is no then it does my head in when they are out of alignment with spaces so I tab.

    Saying that, l have taken code from an IDE and put into sometihng like notepad++ or VSC and it is all skewed. Use a formatter and put back into the IDE and it is off again

    I tend to use a tab and let whatever fix the formatting afterwards and be done

  9. 'arold

    Jeez who cares??

    The correct answer is whatever the team uses, or whatever format the code has already been written in..

    Tabs or spaces - each to their own. Someone who is such a jerk they have to mix formatting because they're so correct - get $%#$%.

    1. anonymous cat herder

      Re: Jeez who cares??

      If only there was some way the formatting style could be saved along with the files themselves, then every editor would be able to convert whatever keystrokes you use into the preferred representation for saving. Some sort of platform-independent editor config file perhaps?

      Every (decent) code editor in existence can support .editorconfig and it makes the code look consistent whoever edits it. I find myself writing custom editorconfig files for all sorts of imported projects, just to preserve their historical, sometimes arcane, tab/space conventions.

  10. Ali Dodd

    As someone pointed out to me a while ago

    Tabs are the answer as they are the only solution to be inclusive. Spaces do not work well with screen readers. So if you respect all the possible recipients of your code you use tabs and only tabs.

    Don't be a jerk.

    1. Geoff Campbell Silver badge

      Re: As someone pointed out to me a while ago

      That, I didn't know. Thank you for extending my knowledge today.

      GJC

    2. Brave Coward

      Re: As someone pointed out to me a while ago

      Very very true, Sir. Whitespaces are not inclusive at all.

    3. ssssssssssssssssssssss

      Re: As someone pointed out to me a while ago

      This is indeed the answer and why tabs should be used, or part of the reason. Visual impairment can also mean having to use huge fonts - space indent means the far too much horizontal scrolling, vs a smaller tab indent size.

      Amusingly devs seem to be the most vocal when it comes to display overrides, like dark mode, font size/choice etc, yet when it comes to formatting code for viewing their way is best. Use tabs for accessibility or spaces if you’re the only one ever to look at your code.

  11. JulieM Silver badge

    Tabs for Makefiles, and when using a proportional font. Spaces everywhere else. And a text editor that knows the difference.

    1. JRStern Bronze badge

      proportional fonts for code, there we go!

      1. JulieM Silver badge

        You wouldn't believe the misconfigurations I've seen in my time. Or the documents laid out using rows of spaces for positioning -- even changing font size for precision.

  12. The BigYin

    It's not about the storage, it's about readability

    If you use spaces, you impose you code preferences on to others.

    If you use tabs, you leave it up to IDE setting on how code should be displayed and thus everyone can have their preference.

    If you are using a space sensitive language (or config format), then quite frankly you deserve everthing you get!

    1. JoeCool Silver badge

      Re: It's not about the storage, it's about readability

      Yes! even back in the days of turbo pascal, i hit the compiler module limit, before i hit the floppy space limit.

    2. Geoff Campbell Silver badge

      Re: It's not about the storage, it's about readability

      This. So very much this.

      Programmers seem to be a species who tend towards imposing their preferences upon others, which is perhaps the core of this whole argument.

      GJC

  13. Geoff Campbell Silver badge
    Boffin

    There's a simple test, really.

    TAB is short for Tabulation. It is a control character designed for aligning textual data on certain pre-set boundaries. It is, in other words, designed exactly and specifically for the job of aligning your code for readability.

    Spaces separate words in text, and go really screwy as soon as they are used in multiples for spacing tabular data out. Use Tabs. It's the only solution that makes sense.

    Thank you for listening to my TED talk.

    GJC

    1. Mage Silver badge

      Re: There's a simple test, really.

      I agree that for human readable documents there should only be single spaces. We have CSS for HTML and paragraph styles for wordprocessing and DTP etc.

      Some programming systems/editors do unfortunately need tabs and many need multiple spaces to be entered, which is stupid.

  14. Matt Dainty

    Some languages have a canonical format, i.e. Golang, Terraform/HCL, etc.. There's no discussion about tabs vs spaces, it's whatever `go fmt` or `terraform fmt` produces, end of argument.

  15. ben kendim

    Really??? This is a problem? Nothing better to write about?

    I use tabs and I use spaces and sometimes I mix them just because I feel like it at the time. Never had a problem, never thought about it.

    If your compiler can't handle that, you need a better compiler.

    If your interpreter can't handle that, you need to be using a compiled language. (In any case, independent of this reason...)

    1. Michael Strorm Silver badge

      Re: Really??? This is a problem? Nothing better to write about?

      If you're not using a language with syntactically-significant indentation, your compiler likely won't give a toss about how you format your code, or what specific form your whitespace takes, beyond the fact it's there.

      Everyone else who has to read your horrid, inconsistent mess of code will, though.

    2. 'arold

      Re: Really??? This is a problem? Nothing better to write about?

      Upvoted for mixing them, never thought about that!

      And now my teammates will never forget.. :D

  16. Tubz Silver badge

    A tab is to make code blocks clear, a space is separate the code itself to help make commands/functions clear. Just because as article says we have more memory and storage, shoddy coding standards is not acceptable. I have seen code that's is decades old and is as clear today to understand due to comments and coding standards, compared to new code that looks like the developer was on vodka crack or as me and my colleagues call them Gen-Git script kiddies.

  17. Ian Johnston Silver badge

    As I recall, at least one VAX/VMS editor (EVE?) converted tabs into spaces, so if you were at column 5 and hit <tab> you'd go to column 8, but would then have to hit <backspace< three times to return to column 5. I rather liked that, as I liked almost everything about the user interface.

  18. Yorick

    > Then there is the near-religious fervor with which developers debate the benefits of vi versus Emacs

    Cast ye not aspersions on our religious fervor! There is nothing "near" about it. May you find enlightenment by the holy `:`.

  19. JRStern Bronze badge

    Should be neither

    With dev studio and fancy modern tools an indent should be an INDENT which can then be rendered, if need be, by your choice of spaces or tabs.

    Or just write an AI program, or maybe ChatGPT can do this now, that will figure it out and pretty-print your code for you after the fact, fix up any tab/space cornfusion.

  20. Quenda

    This is liking arguing if VHS or Beta is better ...

    Is this now a redundant argument? With modern IDEs (example Visual Studio) they automatically do the indentation - I don't know if they use spaces or tabs and I don't really care. Lets find a 21st century trivial issue to argue about.

    1. Michael Strorm Silver badge

      Re: This is liking arguing if VHS or Beta is better ...

      Everyone knows Video 2000 was best, you heathen!

      1. Mage Silver badge

        Re: Video 2000 was best, you heathen!

        Unfortunately by the time Philips had figured how to mass produce heads on piezo actuators, the VHS had won.

        See also decent 1.8" HDDs vs Flash Memory for MP3 players, or Firewire vs USB.

        Video projectors: Fan noise and lamp life vs how big TVs are. DLP was too late except for cinemas which are doomed?

  21. Mage Silver badge
    Coffee/keyboard

    Tab key is for Typewriters

    The only sane use for Tab key is to move to the next field on a form.

    Whatever about program source, it should never be in documents.

    Spaces for indents (but 4 not 8) even on 100k floppies in 1980.

  22. Fruit and Nutcase Silver badge
    Linux

    Net Zero

    As we are not getting to Net Zero anytime soon, there is a case for tabs over spaces due to cost of electricity to process and store all those extra bytes.

    icon: melting ice sheet

  23. mpi Silver badge

    The day the first linter was written...

    ...this debate became moot.

  24. joeldillon

    'Any decent compiler should strip out any extraneous characters, assuming the code is indeed being compiled beforehand and not interpreted at run-time.'

    - not quite sure what this means. You literally can't put a bunch of tabs (or spaces) in machine code or even bytecode, that's what a compiler is producing after all.

  25. tatatata

    Let's start coding:

    While (some condition) {

    <single keypress tab>do something

    }

    or

    While (some condition) {

    <pres a space><pres a space><pres a space><pres a space>do something

    }

    or even worse:

    While (some condition) {

    <pres a space><pres a space><pres a space><pres a space><press one space too many><backspace>do something

    }

    So for me, it is tabs.

    1. doublelayer Silver badge

      As others have noted, nearly every editor has a setting that sets what the tab key does. Press the tab key and, instead of inserting a tab character, it inserts however many space characters you told it to. Press shift+tab and it removes them back to a multiple of the number you set. I use spaces, not because I think spaces are better, but that others think so and I'm willing to go along with them, but I do not press the space key to insert them one at a time. I press the tab key to insert them in chunks of the appropriate size. For the same reason, my editor is also set that, when I press enter to move to a new line, it fills that new line with the same amount of indentation as the last line. Otherwise, I'd have to press tab to indent every line manually and I don't want to.

  26. talk_is_cheap

    It has to be spaces

    There is no defined 'length' for a tab as the original concept comes from manually set 'tabs' on a typewriter. So while one person's IDE may be set to 3 spaces per tab it does not mean that the same indentation will be shown across all the tools that access/process the file with the tabs included.

    If you want to use the tab key, just select an IDE that can convert the tab into spaces for you.

    1. Geoff Campbell Silver badge
      Boffin

      Re: It has to be spaces

      That's the whole point. You write code with tabs to indent the sections, and set the tab stops in the editor to whatever you are comfortable with - maybe every 8 columns, say, because you have a wide monitor and like the code to be spaced that way.

      Any later programmer who works on the code can then set the tabs stops to suit their environment and tastes, maybe every four columns because they have a narrower monitor, or want multiple windows of code open across the width, or just because they like a tighter look when they're working.

      GJC

  27. gi7kmc

    The debate over tabs vs spaces and also how many spaces to use reminded me of the first piece of COBOL I wrote at university. It compiled first time. It didn't do anything as I had indentited it with 1 space too few so it treated everything a comment.

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

Other stories you might like