Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Keep tabs as tabs or tabs as spaces

Keep tabs as tabs or tabs as spaces

Scheduled Pinned Locked Moved The Lounge
question
48 Posts 35 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rob Philpott
    wrote on last edited by
    #1

    You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

    Regards, Rob Philpott.

    OriginalGriffO R N M P 26 Replies Last reply
    0
    • R Rob Philpott

      You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

      Regards, Rob Philpott.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Generally I prefer tabs as tabs, but their are times (when I have to load it into some other package) when I wish I'd left it as spaces. Now, where are the damn tab settings this time...

      Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • R Rob Philpott

        You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

        Regards, Rob Philpott.

        R Offline
        R Offline
        R Giskard Reventlov
        wrote on last edited by
        #3

        Tabs: spaces are the work of the devil. :)

        "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

        1 Reply Last reply
        0
        • R Rob Philpott

          You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

          Regards, Rob Philpott.

          N Offline
          N Offline
          Nemanja Trifunovic
          wrote on last edited by
          #4

          Rob Philpott wrote:

          Or worse yet - "does it matter?"

          No - you just need to be consistent and not mix the two styles within a same file.

          utf8-cpp

          1 Reply Last reply
          0
          • R Rob Philpott

            You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

            Regards, Rob Philpott.

            M Offline
            M Offline
            Maximilien
            wrote on last edited by
            #5

            We use hard tabs at the beginning of code lines and spaces inside the lines. So that if user X use a 2 tabs and looks at code made by Y with 4 tabs the code will only be shifted left (or right if other way around)

            Watched code never compiles.

            J 1 Reply Last reply
            0
            • R Rob Philpott

              You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

              Regards, Rob Philpott.

              P Offline
              P Offline
              Peter Mulholland
              wrote on last edited by
              #6

              I used to think like you, but then I had to deal with a file comparison tool that used 8 spaces for tabs and couldn't be changed. Replace tabs with spaces. ALWAYS! 4 backspaces doesn't take that long. Modern IDEs should reduce that to 1 keystroke anyway. I've found I have much less problems across editors and merge utilites and diff programs when I use spaces.

              Pete

              R T 2 Replies Last reply
              0
              • R Rob Philpott

                You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                Regards, Rob Philpott.

                J Offline
                J Offline
                Joan M
                wrote on last edited by
                #7

                Let's be grateful for the first programmer that made an app to convert tabs to spaces and vice-versa... :rolleyes: I prefer tabs. :thumbsup:

                [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

                G 1 Reply Last reply
                0
                • M Maximilien

                  We use hard tabs at the beginning of code lines and spaces inside the lines. So that if user X use a 2 tabs and looks at code made by Y with 4 tabs the code will only be shifted left (or right if other way around)

                  Watched code never compiles.

                  J Offline
                  J Offline
                  Jim Crafton
                  wrote on last edited by
                  #8

                  Nothing like a hard tab in the morning. I hate it when people try and use soft tabs. I mean really! Soft tabs? That's like drinking Diet Coke. And we all know that only pussies drink Diet Coke - real men use Hard Tabs. All the time. No exceptions. Pftt, soft tabs....

                  ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                  M 1 Reply Last reply
                  0
                  • P Peter Mulholland

                    I used to think like you, but then I had to deal with a file comparison tool that used 8 spaces for tabs and couldn't be changed. Replace tabs with spaces. ALWAYS! 4 backspaces doesn't take that long. Modern IDEs should reduce that to 1 keystroke anyway. I've found I have much less problems across editors and merge utilites and diff programs when I use spaces.

                    Pete

                    R Offline
                    R Offline
                    Rob Philpott
                    wrote on last edited by
                    #9

                    Man, changing your style to please a tool is bad. Why don't you use a better comparison tool, practically all of them allow you to ignore whitespace differences..?

                    Regards, Rob Philpott.

                    P 1 Reply Last reply
                    0
                    • R Rob Philpott

                      Man, changing your style to please a tool is bad. Why don't you use a better comparison tool, practically all of them allow you to ignore whitespace differences..?

                      Regards, Rob Philpott.

                      P Offline
                      P Offline
                      Peter Mulholland
                      wrote on last edited by
                      #10

                      Well, I think the preference on the team I was on, was spaces when i was arguing for tabs. I won that argument, but then the built-in diff tool with whatever source control I was using at one time used 8 spaces for tabs (maybe that was when IBM took over Rational and screwed up the ClearCase help system) Since I've moved to spaces I haven't regretted it (except when other people haven't used my preferences, but that's a either legacy code or a colleague who hasn't been beaten into submission by me changing tabs to spaces in all code I touch) and I'm fairly sure that if you've got tabs set to space in VS now it will backspace the full tab with one keystroke.

                      Pete

                      1 Reply Last reply
                      0
                      • R Rob Philpott

                        You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                        Regards, Rob Philpott.

                        E Offline
                        E Offline
                        Ennis Ray Lynch Jr
                        wrote on last edited by
                        #11

                        It is the efficient vs. the lazy in this argument. Most people are too lazy to change the flow. VS defaults to spaces so why change it. Watch the people who are in favor of coding with spaces actually code. Watch how slow they (usually) work. I am a tab man. All of my code is used only on Windows. I don't have to deal with using Unix and Windows for the same code base and I can type. Yes it matters. There is nothing worse than having to break away from the keyboard to use the mouse.

                        Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

                        N P G Y 4 Replies Last reply
                        0
                        • E Ennis Ray Lynch Jr

                          It is the efficient vs. the lazy in this argument. Most people are too lazy to change the flow. VS defaults to spaces so why change it. Watch the people who are in favor of coding with spaces actually code. Watch how slow they (usually) work. I am a tab man. All of my code is used only on Windows. I don't have to deal with using Unix and Windows for the same code base and I can type. Yes it matters. There is nothing worse than having to break away from the keyboard to use the mouse.

                          Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost

                          N Offline
                          N Offline
                          Nemanja Trifunovic
                          wrote on last edited by
                          #12

                          Ennis Ray Lynch, Jr. wrote:

                          There is nothing worse than having to break away from the keyboard to use the mouse

                          I agree it is bad (although "there is nothing worse" is a tad extreme :) ) to use a mouse while coding, but what it has to do with tabs vs spaces?

                          utf8-cpp

                          1 Reply Last reply
                          0
                          • J Jim Crafton

                            Nothing like a hard tab in the morning. I hate it when people try and use soft tabs. I mean really! Soft tabs? That's like drinking Diet Coke. And we all know that only pussies drink Diet Coke - real men use Hard Tabs. All the time. No exceptions. Pftt, soft tabs....

                            ¡El diablo está en mis pantalones! ¡Mire, mire! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! Personal 3D projects Just Say No to Web 2 Point Blow

                            M Offline
                            M Offline
                            Maximilien
                            wrote on last edited by
                            #13

                            real man don't drink crap.

                            Watched code never compiles.

                            1 Reply Last reply
                            0
                            • R Rob Philpott

                              You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                              Regards, Rob Philpott.

                              T Offline
                              T Offline
                              TheGreatAndPowerfulOz
                              wrote on last edited by
                              #14

                              I would agree with you if I could have tabs as tabs that indent and tabs as spaces on the "interior".

                              "If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams

                              1 Reply Last reply
                              0
                              • R Rob Philpott

                                You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                                Regards, Rob Philpott.

                                B Offline
                                B Offline
                                BRShroyer
                                wrote on last edited by
                                #15

                                I use a ball-peen hammer to indent my code. I carry it everwhere I go. Ever since then, I have had fewer bugs, or at least complaints from the users. Ironically I was looking at this[^] earlier today. To save you the trip, it's about using two spaces or one after a period.

                                Brad Deja Moo - When you feel like you've heard the same bull before.

                                1 Reply Last reply
                                0
                                • R Rob Philpott

                                  You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                                  Regards, Rob Philpott.

                                  G Offline
                                  G Offline
                                  Gary Wheeler
                                  wrote on last edited by
                                  #16

                                  The Minion and I agreed to a compromise. He prefers spaces, and a tab width of 3. I prefer tabs, and a width of 4. We compromised on spaces and a tab width of 4. Of course, if he doesn't stop using Hungarian notation (in C# no less), they'll find his body floating face down in a culvert somewhere...

                                  Software Zen: delete this;

                                  M 1 Reply Last reply
                                  0
                                  • R Rob Philpott

                                    You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                                    Regards, Rob Philpott.

                                    L Offline
                                    L Offline
                                    Lost User
                                    wrote on last edited by
                                    #17

                                    If I prefer a layout with, say, 4 spaces of indent and a co-worker prefers just 2, using spaces means one of us has to suffer. Using Tabs means we can adjust our tabs and see the layout we like (depending on the editor, for sure). VS2010 Pro Power Tools has an option to tell you when you have mixed spaces and tabs, and fix it (into tabs or spaces) for you. So set it up how you want to in VS and let the tools do their job. Of course, if you're not using VS2010 you may have to look at other options - but I believe that the tools we use should provide what we want, and not require us to modify our behavior to suit them.

                                    ___________________________________________ .\\axxx (That's an 'M')

                                    1 Reply Last reply
                                    0
                                    • P Peter Mulholland

                                      I used to think like you, but then I had to deal with a file comparison tool that used 8 spaces for tabs and couldn't be changed. Replace tabs with spaces. ALWAYS! 4 backspaces doesn't take that long. Modern IDEs should reduce that to 1 keystroke anyway. I've found I have much less problems across editors and merge utilites and diff programs when I use spaces.

                                      Pete

                                      T Offline
                                      T Offline
                                      tom1443
                                      wrote on last edited by
                                      #18

                                      I'm in the minority but I agree with Pete - spaces always.

                                      R 1 Reply Last reply
                                      0
                                      • G Gary Wheeler

                                        The Minion and I agreed to a compromise. He prefers spaces, and a tab width of 3. I prefer tabs, and a width of 4. We compromised on spaces and a tab width of 4. Of course, if he doesn't stop using Hungarian notation (in C# no less), they'll find his body floating face down in a culvert somewhere...

                                        Software Zen: delete this;

                                        M Offline
                                        M Offline
                                        Matthew Wilcoxson
                                        wrote on last edited by
                                        #19

                                        Wouldn't it been fairer to use tabs, then you could set the tab to be 3 or 4 or whatever number of spaces wide you like!

                                        G 1 Reply Last reply
                                        0
                                        • R Rob Philpott

                                          You know what I mean - you can have it so that a tab is a tab, and backspace removes it - or you can have it as usually 4 spaces so one tab takes four backspace hits to remove it. I like the first way and despise the second (it offends my need for symmetry), but seem to be alone in this in my current place of work. Or worse yet - "does it matter?" Please reassure me I'm in the right really....

                                          Regards, Rob Philpott.

                                          B Offline
                                          B Offline
                                          Ben Barreth
                                          wrote on last edited by
                                          #20

                                          With my favorite code editors, the convention is: If I select multiple lines and hit tab, it indents it all. If I select multiple lines and hit space, it replaces it all with a single space. 'Nuff said. IMHO this point alone makes tabs the natural choice to mass format lines of code. Sure some editors allow you to get around this by having options to convert the tabs into spaces (so you can still tab multiple lines, the editor just immediately converts them to whitespace). But not all editors have this, which means you may end up changing the format of your code depending on which editor you have open (e.g. VS2010 with the tab-to-space conversion enabled versus SQL studio which doesn't have the option AFAIK).

                                          P 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups