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. A Question of Style

A Question of Style

Scheduled Pinned Locked Moved The Lounge
question
67 Posts 29 Posters 67 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.
  • Richard Andrew x64R Richard Andrew x64

    What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?

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

    Must admit, I prefer tabs, so I can indent 4 spaces, my colleague can indent 2 spaces - without changing source. All is well if using the same editor - but sometimes using notepad etc. stuffs up the tabs

    If I knew then what I know today, then I'd know the same now as I did then - then what would be the point? .\\axxx (That's an 'M')

    B 1 Reply Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #4

      Hi, a TAB character moves the cursor to the next tabular position, whatever that is. on most simple editors (e.g. Notepad) and terminals and terminal emulators, tabular positions are every eight column. on some, its every fourth column (which is more suited for source code). on others (such as Visual Studio), you can specify it. BTW: on good old typewriters, each tab position was set individually where ever you wanted it; same holds true for the tab bar in text editors such as MS Word (where you can use different tab settings for different paragraphs). As a result when you create a file with embedded tabs and send it to some one who uses a different tool, or the same tool with a different setting, chances are your vertical alignments are lost. I use tabs, not spaces, and have tab positions every fourth column. Visual Studio is doing that perfectly. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


      E P 2 Replies Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?

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

        The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.

        Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
        Most of this sig is for Google, not ego.

        L P L N M 6 Replies Last reply
        0
        • L Luc Pattyn

          Hi, a TAB character moves the cursor to the next tabular position, whatever that is. on most simple editors (e.g. Notepad) and terminals and terminal emulators, tabular positions are every eight column. on some, its every fourth column (which is more suited for source code). on others (such as Visual Studio), you can specify it. BTW: on good old typewriters, each tab position was set individually where ever you wanted it; same holds true for the tab bar in text editors such as MS Word (where you can use different tab settings for different paragraphs). As a result when you create a file with embedded tabs and send it to some one who uses a different tool, or the same tool with a different setting, chances are your vertical alignments are lost. I use tabs, not spaces, and have tab positions every fourth column. Visual Studio is doing that perfectly. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


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

          About the only thing it does well.

          Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
          Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
          Most of this sig is for Google, not ego.

          L L 2 Replies Last reply
          0
          • E Ennis Ray Lynch Jr

            The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.

            Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
            Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
            Most of this sig is for Google, not ego.

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

            Take an anvil and a desert spoon. Place both in freezer overnight. Remove from freezer. Place one or more of your testicles on the anvil. Have a friend/colleague/significant other rap, sharply, on your testicle with the spoon. Still think

            There is nothing worse than having to hit the backspace key n-4 times.

            ?

            If I knew then what I know today, then I'd know the same now as I did then - then what would be the point? .\\axxx (That's an 'M')

            N 1 Reply Last reply
            0
            • Richard Andrew x64R Richard Andrew x64

              What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?

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

              Not this again :rolleyes: Ramblings in no particular order: Because Windows and WYSIWYG and such are new-tech. I began programming with a dumb terminal, and the tabs were set there (not in software), and that remains true when I use OpenVMS (except now I use a terminal emulator). I've opened too many files only to find the code misaligned because the last person to touch it used TABs. On Windows I mostly use Edit, which gives four SPACEs per tab. I generally avoid Notepad because it keeps the TABs (eight SPACEs wide X| ). Of course, as long as a file uses one or the other and not a mixture of both it should be OK, but it's easier to untabbify than to tabbify. With SPACEs you know what you're getting.

              L J 2 Replies Last reply
              0
              • E Ennis Ray Lynch Jr

                The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.

                Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
                Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
                Most of this sig is for Google, not ego.

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

                After all the years of having to press the SPACE bar four times, having the editor insert four SPACEs for a TAB is a vast relief; having to press DELETE four times is not that big a deal.

                Ennis Ray Lynch, Jr. wrote:

                non-modern and cross platform editors

                That's what I use primarily.

                A 1 Reply Last reply
                0
                • L Luc Pattyn

                  Hi, a TAB character moves the cursor to the next tabular position, whatever that is. on most simple editors (e.g. Notepad) and terminals and terminal emulators, tabular positions are every eight column. on some, its every fourth column (which is more suited for source code). on others (such as Visual Studio), you can specify it. BTW: on good old typewriters, each tab position was set individually where ever you wanted it; same holds true for the tab bar in text editors such as MS Word (where you can use different tab settings for different paragraphs). As a result when you create a file with embedded tabs and send it to some one who uses a different tool, or the same tool with a different setting, chances are your vertical alignments are lost. I use tabs, not spaces, and have tab positions every fourth column. Visual Studio is doing that perfectly. :)

                  Luc Pattyn [Forum Guidelines] [My Articles]


                  I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


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

                  Luc Pattyn wrote:

                  each tab position was set individually

                  VT100s have that feature too, not sure of its successors, but I expect they must or they wouldn't be compatible.

                  1 Reply Last reply
                  0
                  • E Ennis Ray Lynch Jr

                    The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.

                    Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
                    Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
                    Most of this sig is for Google, not ego.

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #11

                    It is not hard to come up with an editor that removes 1 to 4 tabs after a single BACKSPACE input; I have seen at least one that does exactly that. Actually you couldn't tell whether it was using tabs internally and converted them to/from tabs on file I/O, or was converting tabs to spaces whenever they got entered. :)

                    Luc Pattyn [Forum Guidelines] [My Articles]


                    I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


                    P 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      Not this again :rolleyes: Ramblings in no particular order: Because Windows and WYSIWYG and such are new-tech. I began programming with a dumb terminal, and the tabs were set there (not in software), and that remains true when I use OpenVMS (except now I use a terminal emulator). I've opened too many files only to find the code misaligned because the last person to touch it used TABs. On Windows I mostly use Edit, which gives four SPACEs per tab. I generally avoid Notepad because it keeps the TABs (eight SPACEs wide X| ). Of course, as long as a file uses one or the other and not a mixture of both it should be OK, but it's easier to untabbify than to tabbify. With SPACEs you know what you're getting.

                      L Offline
                      L Offline
                      Luc Pattyn
                      wrote on last edited by
                      #12

                      PIEBALDconsult wrote:

                      With SPACEs you know what you're getting.

                      But at what expense: four spaces is 8 bytes nowadays, one tab used to be a single byte. No wonder the latest and hottest machines keep resembling a TRS-80. :rolleyes:

                      Luc Pattyn [Forum Guidelines] [My Articles]


                      I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


                      P 1 Reply Last reply
                      0
                      • E Ennis Ray Lynch Jr

                        About the only thing it does well.

                        Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
                        Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
                        Most of this sig is for Google, not ego.

                        L Offline
                        L Offline
                        Luc Pattyn
                        wrote on last edited by
                        #13

                        I rather like it, the parts of it I use that is. I've seen worse, both MS and non-MS. Eclipse to name just one, it takes forever to do just anything. :)

                        Luc Pattyn [Forum Guidelines] [My Articles]


                        I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


                        1 Reply Last reply
                        0
                        • L Luc Pattyn

                          It is not hard to come up with an editor that removes 1 to 4 tabs after a single BACKSPACE input; I have seen at least one that does exactly that. Actually you couldn't tell whether it was using tabs internally and converted them to/from tabs on file I/O, or was converting tabs to spaces whenever they got entered. :)

                          Luc Pattyn [Forum Guidelines] [My Articles]


                          I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


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

                          And in all the years I used EDT I never considered writing macroes to do that. :doh:

                          L 1 Reply Last reply
                          0
                          • L Luc Pattyn

                            PIEBALDconsult wrote:

                            With SPACEs you know what you're getting.

                            But at what expense: four spaces is 8 bytes nowadays, one tab used to be a single byte. No wonder the latest and hottest machines keep resembling a TRS-80. :rolleyes:

                            Luc Pattyn [Forum Guidelines] [My Articles]


                            I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


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

                            I considered buying a 1TB hard drive last week, my current 200GB is nearly full of whitespace. At this point I write code just to delineate the whitespace. :-D

                            L 1 Reply Last reply
                            0
                            • P PIEBALDconsult

                              I considered buying a 1TB hard drive last week, my current 200GB is nearly full of whitespace. At this point I write code just to delineate the whitespace. :-D

                              L Offline
                              L Offline
                              Luc Pattyn
                              wrote on last edited by
                              #16

                              PIEBALDconsult wrote:

                              delineate the whitespace.

                              I see. That's like movies aired to keep commercials apart. :)

                              Luc Pattyn [Forum Guidelines] [My Articles]


                              I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


                              1 Reply Last reply
                              0
                              • P PIEBALDconsult

                                And in all the years I used EDT I never considered writing macroes to do that. :doh:

                                L Offline
                                L Offline
                                Luc Pattyn
                                wrote on last edited by
                                #17

                                Neither did I, EDT was just great at that time. :)

                                Luc Pattyn [Forum Guidelines] [My Articles]


                                I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


                                P 1 Reply Last reply
                                0
                                • L Luc Pattyn

                                  Neither did I, EDT was just great at that time. :)

                                  Luc Pattyn [Forum Guidelines] [My Articles]


                                  I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


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

                                  I just did try it. Actually I found that EDT has some built-in support, but I couldn't get it to work. Maybe LSE does it better.

                                  L 1 Reply Last reply
                                  0
                                  • E Ennis Ray Lynch Jr

                                    About the only thing it does well.

                                    Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
                                    Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
                                    Most of this sig is for Google, not ego.

                                    L Offline
                                    L Offline
                                    lepipele
                                    wrote on last edited by
                                    #19

                                    VS.NET is the best IDE.

                                    P 1 Reply Last reply
                                    0
                                    • P PIEBALDconsult

                                      I just did try it. Actually I found that EDT has some built-in support, but I couldn't get it to work. Maybe LSE does it better.

                                      L Offline
                                      L Offline
                                      Luc Pattyn
                                      wrote on last edited by
                                      #20

                                      I've never really used LSE, I trust it does everything EDT did/does. :)

                                      Luc Pattyn [Forum Guidelines] [My Articles]


                                      I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


                                      P 1 Reply Last reply
                                      0
                                      • L lepipele

                                        VS.NET is the best IDE.

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

                                        Uuuuuhhhh... so? :confused:

                                        1 Reply Last reply
                                        0
                                        • L Luc Pattyn

                                          I've never really used LSE, I trust it does everything EDT did/does. :)

                                          Luc Pattyn [Forum Guidelines] [My Articles]


                                          I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.


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

                                          Every time I've accidently gotten into it I've had to Ctrl-C out because I couldn't figure out the right way. :sigh:

                                          L 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