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. Indenting: spaces or tabs?

Indenting: spaces or tabs?

Scheduled Pinned Locked Moved The Lounge
visual-studiocomquestion
39 Posts 25 Posters 4 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.
  • L Offline
    L Offline
    Luca Leonardo Scorcia
    wrote on last edited by
    #1

    A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

    L P S M _ 15 Replies Last reply
    0
    • L Luca Leonardo Scorcia

      A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

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

      Tabs, set to 8 spaces. Been the same since I started with C back in 1988.


      Faith. Believing in something you *know* isn't true.

      1 Reply Last reply
      0
      • L Luca Leonardo Scorcia

        A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        Spaces. Don't ask about how many, it's a mess.... (I prefer two.)


        Auch den Schatten will ich lieben weil ich manchmal lieber frier'  Rosenstolz   [sighist]

        U 1 Reply Last reply
        0
        • L Luca Leonardo Scorcia

          A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

          S Offline
          S Offline
          Senkwe Chanda
          wrote on last edited by
          #4

          Default tabs :-) ASP.NET can never fail as working with it is like fitting bras to supermodels - it's one pleasure after the next - David Wulff

          1 Reply Last reply
          0
          • P peterchen

            Spaces. Don't ask about how many, it's a mess.... (I prefer two.)


            Auch den Schatten will ich lieben weil ich manchmal lieber frier'  Rosenstolz   [sighist]

            U Offline
            U Offline
            Uwe Keim
            wrote on last edited by
            #5

            Deutsche Signatur, das hat doch was :-) -- See me: www.magerquark.de

            1 Reply Last reply
            0
            • L Luca Leonardo Scorcia

              A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

              M Offline
              M Offline
              Michael P Butler
              wrote on last edited by
              #6

              How to start a religious war in one easy post :-D LOL Personally I've used tabs since I started in C back in 1989. I have my tab set at 4. The code is readable, which is the most important thing. Michael Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.

              S 1 Reply Last reply
              0
              • L Luca Leonardo Scorcia

                A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                _ Offline
                _ Offline
                _Magnus_
                wrote on last edited by
                #7

                I want to use tabs but have to use spaces, and it sucks.. X| With tabs everybody can have the tabwidth they want. If you want to delete the tab you just type you only have to press backspace once. Easier to reformat the code. I cant see a single advantage with using spaces. /Magnus


                - I don't necessarily agree with everything I say

                V T 2 Replies Last reply
                0
                • L Luca Leonardo Scorcia

                  A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                  D Offline
                  D Offline
                  Daniel Turini
                  wrote on last edited by
                  #8

                  If you are worried about tabs and spaces you're using the wrong set of programming tools... :zzz: :zzz: :zzz: Concussus surgo. When struck I rise.

                  L P 2 Replies Last reply
                  0
                  • _ _Magnus_

                    I want to use tabs but have to use spaces, and it sucks.. X| With tabs everybody can have the tabwidth they want. If you want to delete the tab you just type you only have to press backspace once. Easier to reformat the code. I cant see a single advantage with using spaces. /Magnus


                    - I don't necessarily agree with everything I say

                    V Offline
                    V Offline
                    Vagif Abilov
                    wrote on last edited by
                    #9

                    _Magnus_ wrote: With tabs everybody can have the tabwidth they want. If you want to delete the tab you just type you only have to press backspace once. Easier to reformat the code. Fully agree. This the main reason I use tabs: everybody can have the tabwidth they want, without reformatting the code. Take a team of 3 space lovers: they all ident text with different number of spaces. This is why spacers suck and tabers rule! ;) Vagif Abilov MCP (Visual C++) Oslo, Norway Hex is for sissies. Real men use binary. And the most hardcore types use only zeros - uppercase zeros and lowercase zeros. Tomasz Sowinski

                    1 Reply Last reply
                    0
                    • D Daniel Turini

                      If you are worried about tabs and spaces you're using the wrong set of programming tools... :zzz: :zzz: :zzz: Concussus surgo. When struck I rise.

                      L Offline
                      L Offline
                      Luca Leonardo Scorcia
                      wrote on last edited by
                      #10

                      I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                      M D D 3 Replies Last reply
                      0
                      • L Luca Leonardo Scorcia

                        A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                        S Offline
                        S Offline
                        Simon Walton
                        wrote on last edited by
                        #11

                        Tabs, without a doubt. I can't understand why you would use spaces when you can set the editor to indent tabs by x for you.

                        8

                        SIMON WALTON
                        SONORK ID 100.10024

                        P 1 Reply Last reply
                        0
                        • L Luca Leonardo Scorcia

                          A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

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

                          Tabs, set to 4 spaces :) Elaine (fluffy tigress emoticon) Would you like to meet my teddy bear ?

                          J 1 Reply Last reply
                          0
                          • L Luca Leonardo Scorcia

                            A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                            M Offline
                            M Offline
                            Megan Forbes
                            wrote on last edited by
                            #13

                            tabs set to 4 spaces. If you need to use notepad for any unfortunate reason, it is better to go to DOS and use it's editor - you can set tabs in that too The following statement about your geekness is true. The previous statement about your geekness is not true. GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M-- PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++ h--- r+++

                            1 Reply Last reply
                            0
                            • L Luca Leonardo Scorcia

                              I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                              M Offline
                              M Offline
                              Megan Forbes
                              wrote on last edited by
                              #14

                              Use the DOS editor...;P The following statement about your geekness is true. The previous statement about your geekness is not true. GCS/IT/P d- s: a- C++++$ UL+>++++ P+ L++$ E- W+++$ N !o K+ w++$ O---- M-- PS- PE Y+ PGP--- t !5 X- tv b+++ DI++ D+ G++ e++ h--- r+++

                              G 1 Reply Last reply
                              0
                              • M Michael P Butler

                                How to start a religious war in one easy post :-D LOL Personally I've used tabs since I started in C back in 1989. I have my tab set at 4. The code is readable, which is the most important thing. Michael Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.

                                S Offline
                                S Offline
                                Sijin
                                wrote on last edited by
                                #15

                                Michael P Butler wrote: I have my tab set at 4. Me 2 :) :) May the Source be with you Sonork ID 100.9997 sijinjoseph

                                1 Reply Last reply
                                0
                                • L Luca Leonardo Scorcia

                                  I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                                  D Offline
                                  D Offline
                                  Dan Morris
                                  wrote on last edited by
                                  #16

                                  Luca Leonardo Scorcia wrote: If only notepad had the Tab Size option... I use a cool little tool "TextPad" (I'm sure there are others like it) that is a suped-up version of Notepad. You can set tabs to whatever you'd like. I use it to quickly view files without having to open any IDE's. And it has support for syntax coloring for various languages etc. Check it out: http://www.textpad.com [^] Dan Morris _____________________________________ "An eye for an eye makes the whole world blind." - Ghandi

                                  1 Reply Last reply
                                  0
                                  • L Luca Leonardo Scorcia

                                    A little survey about your code-indent style... what do you use? Spaces or tabs? I used to do a mix of tabs and spaces, but the code looked awful when edited with VS and then opened with notepad for a quick look. So I started using only spaces, but I noticed that for some files indentation made the file size grow a lot... now I'm using only tabs. I think that's the best way: any serious code editor can set the tab size to any number of space you want, code in notepad looks fine, and it's faster to type and files don't get too large. These are my 2 cents. And yours? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                                    V Offline
                                    V Offline
                                    Vuemme
                                    wrote on last edited by
                                    #17

                                    Tabs set to 4 spaces. And I usually ident code with open and close braces on a separate row: ex: if () { } else { } Here you'll find some code idented in a funny way :) P.S. In some languages (python, for example) identing is mandatory. -- Looking for a new screen-saver? Try FOYD: http://digilander.iol.it/FOYD

                                    S 1 Reply Last reply
                                    0
                                    • L Lost User

                                      Tabs, set to 4 spaces :) Elaine (fluffy tigress emoticon) Would you like to meet my teddy bear ?

                                      J Offline
                                      J Offline
                                      Jason Hooper
                                      wrote on last edited by
                                      #18

                                      Ditto... in vi, notepad, vc++, etc. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

                                      W 1 Reply Last reply
                                      0
                                      • L Luca Leonardo Scorcia

                                        I'm using VS.NET for heavy editing and notepad... for everything else :) Actually it's not when using a single program that I notice the difference, but when I have to use different editors. If only notepad had the Tab Size option... BTW, which programming tools are you using? Luca Leonardo Scorcia http://zip.to/kojak (only in Italian)

                                        D Offline
                                        D Offline
                                        Daniel Turini
                                        wrote on last edited by
                                        #19

                                        I mainly use VS.NET and UltraEdit. UltraEdit is the one of the best text editors I've seen to date. Highly configurable, but the default configuration rocks! The other editor which brings me good memories is Boxer (for DOS, unfortunately - the Windows version sucks). Concussus surgo. When struck I rise.

                                        1 Reply Last reply
                                        0
                                        • J Jason Hooper

                                          Ditto... in vi, notepad, vc++, etc. - Jason (SonorkID 100.611) The Code Project - Orange makes the art grow fonder

                                          W Offline
                                          W Offline
                                          Wouter Dhondt
                                          wrote on last edited by
                                          #20

                                          Ahhh, vi. Man's favourite editor. Or: how to make something incredibly difficult, which could be made very easy so that only true geeks can use it... New and improved: kwakkelflap.com "When I hear of Schrödinger's cat, I reach for my gun." - Stephen Hawking

                                          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