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. Tabs vs Spaces

Tabs vs Spaces

Scheduled Pinned Locked Moved The Lounge
visual-studiohelpquestion
63 Posts 43 Posters 27 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.
  • M Mike Hankey

    Beer cans used to have tabs...so I prefer tabs. :)

    PartsBin an Electronics Part Organizer - A updated version available! JaxCoder.com

    C Offline
    C Offline
    Choroid
    wrote on last edited by
    #41

    Competition for your "PartsBin" Wait... What? I Made a Small Parts Organizer with Drawers from Cardboard! - YouTube[^] Perhaps include this as an add on

    M 1 Reply Last reply
    0
    • C Choroid

      Competition for your "PartsBin" Wait... What? I Made a Small Parts Organizer with Drawers from Cardboard! - YouTube[^] Perhaps include this as an add on

      M Offline
      M Offline
      Mike Hankey
      wrote on last edited by
      #42

      Awesome thanks for the link. Good storage alternative, especially since the organizers are so dang expensive.

      PartsBin an Electronics Part Organizer - A updated version available! JaxCoder.com

      1 Reply Last reply
      0
      • K Kevin Marois

        Quick survey... How many of you uses tabs vs spaces to indent your code?

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        M Offline
        M Offline
        Member_15777962
        wrote on last edited by
        #43

        I use Tabs for Columns, and spaces for strings, Carriage Return/Line Feed for new Row. Makes sense when Using Excel. For notepad it doesn't matter :-)

        1 Reply Last reply
        0
        • K Kevin Marois

          Quick survey... How many of you uses tabs vs spaces to indent your code?

          If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

          J Offline
          J Offline
          Jim Spencer100
          wrote on last edited by
          #44

          If(spaceToAdd > 1) { Tab(); } else { Space(); } // This is how my brain does it :P

          1 Reply Last reply
          0
          • K Kevin Marois

            Quick survey... How many of you uses tabs vs spaces to indent your code?

            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

            E Offline
            E Offline
            englebart
            wrote on last edited by
            #45

            I prefer tabs. Our code size in bytes could double or quadruple or ? based on how many spaces were substituted. A lot of lines in brace delimited languages are 8 tabs, open or close brace. Python, stick to spaces!

            1 Reply Last reply
            0
            • K Kevin Marois

              Quick survey... How many of you uses tabs vs spaces to indent your code?

              If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

              S Offline
              S Offline
              StatementTerminator
              wrote on last edited by
              #46

              I use tab and shift+tab in VS to keep things in neat code blocks. I don't really care how many spaces a tab is as long as it's consistent (I use the default). I've never seen a good reason to use spaces, whenever I see code like that it's usually a mess. It's possible to format code well using spaces, but that's not what I usually see in the wild.

              1 Reply Last reply
              0
              • K Kevin Marois

                Quick survey... How many of you uses tabs vs spaces to indent your code?

                If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                J Offline
                J Offline
                Juan Pablo Reyes Altamirano
                wrote on last edited by
                #47

                If it doesn't auto-indent, I will tab. But now I wonder if K&R C had anything to say about that :~

                1 Reply Last reply
                0
                • K Kevin Marois

                  Quick survey... How many of you uses tabs vs spaces to indent your code?

                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                  J Offline
                  J Offline
                  James Curran
                  wrote on last edited by
                  #48

                  I use Tabs (as the Good Lord Intended)

                  Truth, James

                  1 Reply Last reply
                  0
                  • K Kevin Marois

                    Quick survey... How many of you uses tabs vs spaces to indent your code?

                    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                    G Offline
                    G Offline
                    Gary R Wheeler
                    wrote on last edited by
                    #49

                    I used tabs until Visual Studio .NET 2003 unrecoverably broke the block indent/undent operation when you mixed tabs and spaces. After that I switched to spaces. And yes, this same operation has been broken ever since. VC6 would let you have {tab}{tab}{sp}{sp}stuff, and when you indented, that became {tab}{tab}{tab}{sp}{sp}stuff. All versions since then have stripped the leading tabs and/or spaces and inserted N tabs or N*s spaces. Studio has been through more than one editor rewrite since then, and it still doesn't work right. I'm using VS2019 now, and it occasionally decides to treat indents as blocks. It's not predictable though.

                    Software Zen: delete this;

                    1 Reply Last reply
                    0
                    • M Mark Starr

                      Indent? That’s really a thing? I just left-align everything. Tried right-align, but that was messy. :)

                      Time is the differentiation of eternity devised by man to measure the passage of human events. - Manly P. Hall Mark Just another cog in the wheel

                      G Offline
                      G Offline
                      Gary R Wheeler
                      wrote on last edited by
                      #50

                      Use RTL text (or even better bidi), I dare you.

                      Software Zen: delete this;

                      1 Reply Last reply
                      0
                      • P PIEBALDconsult

                        No, TAB stops are by distance, not character count. A half inch is sufficient.

                        O Offline
                        O Offline
                        ormonds
                        wrote on last edited by
                        #51

                        Inches? I still use cubits.

                        P 1 Reply Last reply
                        0
                        • O ormonds

                          Inches? I still use cubits.

                          P Offline
                          P Offline
                          PIEBALDconsult
                          wrote on last edited by
                          #52

                          So did Hitler.

                          O 1 Reply Last reply
                          0
                          • K Kevin Marois

                            Quick survey... How many of you uses tabs vs spaces to indent your code?

                            If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                            D Offline
                            D Offline
                            Daniel Wilianto
                            wrote on last edited by
                            #53

                            I always use IDE for coding. All IDEs that I use convert tab to spaces automatically. I always press TAB on keyboard when I want to indent, though. Since less keystroke is faster and better. So you could say that I am a TAB guy? But I am perfectly fine with it saved as spaces.

                            1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              So did Hitler.

                              O Offline
                              O Offline
                              ormonds
                              wrote on last edited by
                              #54

                              You just reinforced Godwin's Law.

                              1 Reply Last reply
                              0
                              • K Kevin Marois

                                Quick survey... How many of you uses tabs vs spaces to indent your code?

                                If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                U Offline
                                U Offline
                                User 14060113
                                wrote on last edited by
                                #55

                                I use tabs bc using spaces is rude. For example, I personally prefer .html or .xaml files with an indentation of 3 spaces, for other file types I prefer 4 spaces. This is not possible if some ruthless predecessor inserted spaces according to his, probably different, personal preferences in the source files. Or if I am the predecessor, then I would force my 3 spaces upon other people. That's not the way to treat each other.

                                1 Reply Last reply
                                0
                                • K Kevin Marois

                                  Quick survey... How many of you uses tabs vs spaces to indent your code?

                                  If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                  Y Offline
                                  Y Offline
                                  YSLGuru
                                  wrote on last edited by
                                  #56

                                  Bad tabs, bad Tabs, whatcha gonna do, whatcha gonna do when they screw the code up for you?

                                  1 Reply Last reply
                                  0
                                  • K Kevin Marois

                                    Quick survey... How many of you uses tabs vs spaces to indent your code?

                                    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                    Y Offline
                                    Y Offline
                                    YSLGuru
                                    wrote on last edited by
                                    #57

                                    As a SQL dev it's SPACES all the way. I use a TAB to insert 2 spaces but never use the TAB character within my code.

                                    1 Reply Last reply
                                    0
                                    • D David Crow

                                      I use the TAB key to insert SPACES.

                                      "One man's wage rise is another man's price increase." - Harold Wilson

                                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                                      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                                      R Offline
                                      R Offline
                                      Roger House
                                      wrote on last edited by
                                      #58

                                      Ditto

                                      1 Reply Last reply
                                      0
                                      • K Kevin Marois

                                        Quick survey... How many of you uses tabs vs spaces to indent your code?

                                        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

                                        S Offline
                                        S Offline
                                        Shmoken99
                                        wrote on last edited by
                                        #59

                                        Is Spaces a slang term for Diet Coke? If so I definitely prefer it to Tab.

                                        1 Reply Last reply
                                        0
                                        • Greg UtasG Greg Utas

                                          I would've never thought there could be a good argument for tabs, but this sounds like a good way to satisfy everyone. My only question would be what the code looks like outside the IDE, in GitHub or even Notepad, for example.

                                          Robust Services Core | Software Techniques for Lemmings | Articles
                                          The fox knows many things, but the hedgehog knows one big thing.

                                          D Offline
                                          D Offline
                                          DRHuff
                                          wrote on last edited by
                                          #60

                                          No, no, no! If you think that you have found a good argument on the internet... :-D Thanks for the comment though. It is surprising the number of times I have brought this point up and people that were dead set against tabs get a surprised look on their faces. Never thought of that before. Every indentation is 1 tab - what you want it to look like is up to you. And if you use notepad to look at code - well I can't help everybody!

                                          If you can't laugh at yourself - ask me and I will do it for you.

                                          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