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, Spaces, 2 column widths, 4 column widths, oh my...

Tabs, Spaces, 2 column widths, 4 column widths, oh my...

Scheduled Pinned Locked Moved The Lounge
csharpc++javascriptrubysysadmin
42 Posts 23 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.
  • L Lost User

    Spaces rule and tabs drool. 2 spaces to be exact.

    Whenever you find yourself on the side of the majority, it is time to pause and reflect. ~ Mark Twain

    J Offline
    J Offline
    Jeremy Falcon
    wrote on last edited by
    #4

    2 spaces in all environments, like even C#?

    Jeremy Falcon

    L 1 Reply Last reply
    0
    • L Lost User

      3 is still a bit too wide so I prefer 2.718 spaces per tab.

      J Offline
      J Offline
      Jeremy Falcon
      wrote on last edited by
      #5

      Touché

      Jeremy Falcon

      1 Reply Last reply
      0
      • J Jeremy Falcon

        2 spaces in all environments, like even C#?

        Jeremy Falcon

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

        I don't develop with C# so... YES! Even C#. :laugh:

        Whenever you find yourself on the side of the majority, it is time to pause and reflect. ~ Mark Twain

        J 1 Reply Last reply
        0
        • J Jeremy Falcon

          Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

          Jeremy Falcon

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

          I like a half inch per indent level, so it depends on font (I prefer 8-point Andale Mono), screen size/resolution etc.

          J 1 Reply Last reply
          0
          • P PIEBALDconsult

            I like a half inch per indent level, so it depends on font (I prefer 8-point Andale Mono), screen size/resolution etc.

            J Offline
            J Offline
            Jeremy Falcon
            wrote on last edited by
            #8

            I gotcha... similar principle then... as far as wanting visual consistency.

            Jeremy Falcon

            1 Reply Last reply
            0
            • L Lost User

              I don't develop with C# so... YES! Even C#. :laugh:

              Whenever you find yourself on the side of the majority, it is time to pause and reflect. ~ Mark Twain

              J Offline
              J Offline
              Jeremy Falcon
              wrote on last edited by
              #9

              Oh snap.

              Jeremy Falcon

              1 Reply Last reply
              0
              • J Jeremy Falcon

                Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                Jeremy Falcon

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

                The perfect width for a tab or spaces is... 42 :) I use 4, always have, always will. If any of my devs use more or less or convert to spaces they are publicly humiliated and forced to wear mittens to code for the next week until they learn that 4 is THE magic number when it comes to tabs and tabs are as close to perfection as code spacing and indents can possibly get. :)

                J 1 Reply Last reply
                0
                • J Jeremy Falcon

                  Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                  Jeremy Falcon

                  M Offline
                  M Offline
                  Marco Bertschi
                  wrote on last edited by
                  #11

                  I go along with whatever the IDE inserts for me when I hit TAB. What I hate is when VS separates the start (<) and end (>) of generic parameters onto separate lines. I don't have a problem with method call chains or method parameters spanning multiple lines, but those generic parameters belong onto the same darn line!

                  I only have a signature in order to let @DalekDave follow my posts.

                  T 1 Reply Last reply
                  0
                  • R R Giskard Reventlov

                    The perfect width for a tab or spaces is... 42 :) I use 4, always have, always will. If any of my devs use more or less or convert to spaces they are publicly humiliated and forced to wear mittens to code for the next week until they learn that 4 is THE magic number when it comes to tabs and tabs are as close to perfection as code spacing and indents can possibly get. :)

                    J Offline
                    J Offline
                    Jeremy Falcon
                    wrote on last edited by
                    #12

                    Come on man... give spaces a try. Peddling this like a drug dealer. Only the first space is free. :rolleyes: Not to open up that can of worms, but I was a hardcore tabs guy for years. But spaces are universal. Once I got used to spaces, I could see my code formatted well in any IDE. I could upload it to the web server, output or inspect it in the terminal on Unix/Linux or command line or Notepad in Winders and it still was formatted well. Basically, it made life more portable. I never went back.

                    Jeremy Falcon

                    R 1 Reply Last reply
                    0
                    • J Jeremy Falcon

                      Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                      Jeremy Falcon

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

                      Been through the same journey as you. I like best 3 columns, but my current work requires 4 columns. Ah well.

                      #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                      J 1 Reply Last reply
                      0
                      • T TheGreatAndPowerfulOz

                        Been through the same journey as you. I like best 3 columns, but my current work requires 4 columns. Ah well.

                        #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                        J Offline
                        J Offline
                        Jeremy Falcon
                        wrote on last edited by
                        #14

                        You're a smart man! :thumbsup:

                        Jeremy Falcon

                        1 Reply Last reply
                        0
                        • J Jeremy Falcon

                          Come on man... give spaces a try. Peddling this like a drug dealer. Only the first space is free. :rolleyes: Not to open up that can of worms, but I was a hardcore tabs guy for years. But spaces are universal. Once I got used to spaces, I could see my code formatted well in any IDE. I could upload it to the web server, output or inspect it in the terminal on Unix/Linux or command line or Notepad in Winders and it still was formatted well. Basically, it made life more portable. I never went back.

                          Jeremy Falcon

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

                          Chuck Norris uses Tabs. So should you. :-)

                          J D 2 Replies Last reply
                          0
                          • R R Giskard Reventlov

                            Chuck Norris uses Tabs. So should you. :-)

                            J Offline
                            J Offline
                            Jeremy Falcon
                            wrote on last edited by
                            #16

                            Oooooooh snap. :laugh:

                            Jeremy Falcon

                            1 Reply Last reply
                            0
                            • J Jeremy Falcon

                              Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                              Jeremy Falcon

                              D Offline
                              D Offline
                              David ONeil
                              wrote on last edited by
                              #17

                              Jeremy Falcon wrote:

                              And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins.

                              And unworthy of my answer, so go away! Oh, wait, I've been ahead of you[^] for quite some time in this respect.

                              It Is The Absolute Verifiable Truth & Proven Fact

                              That Your Belly-Button Signature Ties

                              To Viviparous Mama.

                              1 Reply Last reply
                              0
                              • J Jeremy Falcon

                                Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                                Jeremy Falcon

                                M Offline
                                M Offline
                                Mycroft Holmes
                                wrote on last edited by
                                #18

                                2 columns and use tabs all applications, including TSQL. ctrl e d will reformat the current file in c#. Red-Gate has an excellent formatter for stored procs. As the lead developer I set the standards and if I find someone has reformatted my code I get quite grumpy.

                                Never underestimate the power of human stupidity RAH

                                J 1 Reply Last reply
                                0
                                • M Mycroft Holmes

                                  2 columns and use tabs all applications, including TSQL. ctrl e d will reformat the current file in c#. Red-Gate has an excellent formatter for stored procs. As the lead developer I set the standards and if I find someone has reformatted my code I get quite grumpy.

                                  Never underestimate the power of human stupidity RAH

                                  J Offline
                                  J Offline
                                  Jeremy Falcon
                                  wrote on last edited by
                                  #19

                                  Mycroft Holmes wrote:

                                  As the lead developer I set the standards and if I find someone has reformatted my code I get quite grumpy

                                  That's the biggest thing... everyone being on the same page. I'll never get you two column folks. :laugh: But I do think the project will suffer if the team can't agree on one.

                                  Jeremy Falcon

                                  1 Reply Last reply
                                  0
                                  • J Jeremy Falcon

                                    Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                                    Jeremy Falcon

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

                                    Now with wide displays is not as important, but 2 spaces (using tab) is good as it is not very space consuming but at the same time is clear enough to see the desired effect. And of course this doesn't allow any debate. I'm right. Anyone thinking a different thing must be burnt in fire. :rolleyes:

                                    www.robotecnik.com[^] - robots, CNC and PLC programming

                                    https://www.robotecnik.com freelance robots, PLC and CNC programmer.

                                    J 1 Reply Last reply
                                    0
                                    • R R Giskard Reventlov

                                      Chuck Norris uses Tabs. So should you. :-)

                                      D Offline
                                      D Offline
                                      Daniel Pfeffer
                                      wrote on last edited by
                                      #21

                                      Chuck Norris is NOT celebrated for his programming abilities.

                                      If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                                      R 1 Reply Last reply
                                      0
                                      • J Jeremy Falcon

                                        Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                                        Jeremy Falcon

                                        D Offline
                                        D Offline
                                        Daniel Pfeffer
                                        wrote on last edited by
                                        #22

                                        I've used so many differing styles (usually mandated by anal-retentive bosses) that today I just go with whatever (a) the company requires, or (b) the IDE inserts as a default. The only problem with using tabs as a formatting mechanism is when reading code in a different editor, whose tab setting differs. Your nicely (and carefully) formatted code then looks like a formatting disaster. :sigh:

                                        If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack. --Winston Churchill

                                        J 1 Reply Last reply
                                        0
                                        • J Jeremy Falcon

                                          Now you know, we as nerds just love a good debate. And clearly, everyone who doesn't agree with us is intellectually inferior by substantial margins. And no other topic, save a few, has this proven to more evident than in the tabs versus spaces great debate of our generation. Now, rather than fan the flame of that saga, I'm curious to know what people still prefer for tab width (regardless of an actual tab char or if it's spaces). For years, I've always been a four column guy with tab widths. I mean years. Anything else was stupid and bunches together what would otherwise be beautiful code. But then I started doing a lot of JavaScript development where the popular thing is to use two column widths. Ruby seems to embrace that too. It's ugly I thought. I shan't cave in. It's immoral and just wrong. But in being a team player you go along with what must be done for the sake of the project. Now, a couple years later. I look at four column tab width code and think "well gee that's just too damn wide." I still don't like two column width. Looks like the code is still in kiddy land when I see that. I started doing some plug-in development for a Forex trading platform a few years back. It's a proprietary language and by default it uses 3 column widths in the code editor for it. At first I was like "ok wtf." But after years of using that proprietary language... turns out 3 column width is perfect! You can use it everywhere. C#, C/C++, JavaScript. Whatever, it's a nice compromise for everyone. In this day and age where we are expected to learn 20 million things, both client and server, rather than just one language, I tend to find myself using this more and more so I don't have to readjust my eyes to differently spaced code all day long. Only problem is... nobody else uses 3 column widths that I know of. So, I'm curious to know, what do y'all use still and why?

                                          Jeremy Falcon

                                          J Offline
                                          J Offline
                                          jsc42
                                          wrote on last edited by
                                          #23

                                          Always used 3 spaces for punch cards. Reasonable compromise for easy resorting when the deck was dropped v maximising levels of indentation given that the width of a card was 80 cols, and the last 8 of then were for sequence numbers. (Also useful for old versions of FORTRAN where statements started in col 7 - 2 * 3 spaces). Now we have screens, I use TAB (only 1 key stroke) and accept whatever the editor of the day displays it at. I still try to limit lines to 80 chars.

                                          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