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-studioquestion
51 Posts 26 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.
  • T Taka Muraoka

    People who use tabs should be shot!!!


    Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.4 (beta)[^]: A free RSS reader with support for Code Project.

    D Offline
    D Offline
    David Wulff
    wrote on last edited by
    #42

    The first thing I do when I open a code file that isn't mine is CTRL+A ALT+F8. And if that doesn't catch them all, a quick "Tabify selection" does the trick. :-D So when should I expect to see you?


    David Wulff

    "It is a helpless feeling to be unable to make something so terribly wrong... right."

    T 1 Reply Last reply
    0
    • T Taka Muraoka

      Don't sweat the petty stuff. Spaces vs. tabs is much more important :-|


      Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.4 (beta)[^]: A free RSS reader with support for Code Project.

      D Offline
      D Offline
      David Wulff
      wrote on last edited by
      #43

      Don't sweat the petty stuff and don't pet the sweaty stuff. What is Chris Meech that said that, it rings a bell? :)


      David Wulff

      "It is a helpless feeling to be unable to make something so terribly wrong... right."

      1 Reply Last reply
      0
      • T Taka Muraoka

        jdunlap wrote: I don't want to have to go space-space-space-space for each indent. Virtually every editor on the planet has a switch to insert spaces instead of tabs. jdunlap wrote: Why not use spaces for comments, etc, and then tabs for other indents? Consistency. If you use one of the above-mentioned editors, then you don't have to remember anything.


        Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.4 (beta)[^]: A free RSS reader with support for Code Project.

        D Offline
        D Offline
        David Wulff
        wrote on last edited by
        #44

        Taka Muraoka wrote: Virtually every editor on the planet has a switch to insert spaces instead of tabs Yes, but what about backspacing? :rolleyes:


        David Wulff

        "It is a helpless feeling to be unable to make something so terribly wrong... right."

        1 Reply Last reply
        0
        • D David Wulff

          The first thing I do when I open a code file that isn't mine is CTRL+A ALT+F8. And if that doesn't catch them all, a quick "Tabify selection" does the trick. :-D So when should I expect to see you?


          David Wulff

          "It is a helpless feeling to be unable to make something so terribly wrong... right."

          T Offline
          T Offline
          Taka Muraoka
          wrote on last edited by
          #45

          David Wulff wrote: The first thing I do when I open a code file that isn't mine is CTRL+A ALT+F8. S.Rod suggested the same thing but this is not the answer. 1) Not everyone uses Visual Studio. I ran into this problem the most when I was working under UNIX. 2) Checking such a file back into source control is a real PITA because it becomes really hard to tell what is a legitimate change and what is tab-fixing. David Wulff wrote: So when should I expect to see you? Any time. Any place. :-|


          Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.4 (beta)[^]: A free RSS reader with support for Code Project.

          1 Reply Last reply
          0
          • N Navin

            Tabs. I just find them easier, especially when arrowing through code (takes less time to go through tabs than it does spaces.) And now that's dictated in our team's coding standard. :-D Although with all the nifty souce formatting tools out there (including what's included in Visual), it doesn't matter as much as it used to... back in the days when taking out a block of code embedded deep in a loop and putting it into its own function meant a day's worth of work deleting all the extra spaces. "When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein

            R Offline
            R Offline
            roel_
            wrote on last edited by
            #46

            Use Ctrl-Arrows to jump word-style. And vi has been able to move blocks of code one indentation (which as we all know is 4 spaces) for almost 30 years now ;P

            1 Reply Last reply
            0
            • T Taka Muraoka

              jdunlap wrote: tell us why tabs are so bad. Have you ever had to work on source code written by somebody who had their tab stops set differently to you?


              Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.4 (beta)[^]: A free RSS reader with support for Code Project.

              M Offline
              M Offline
              markkuk
              wrote on last edited by
              #47

              There's only one correct way to set tabs (every 8 chars), so this isn't a problem. ;P

              1 Reply Last reply
              0
              • R Rein Hillmann

                I know that this is quite a heated debate and I was always on the "Tabs forever" side of the argument but recently I've switched to spaces instead of tabs (due to factors outside of my control) and to be honest, I'm LOVING it. Now I can align all my code the way I like it and not have to worry about the tabs lining up with the parenthesis. What do you guys mostly use? Do your companies have a convention on this?

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

                Tabs :) The tigress is here :-D

                1 Reply Last reply
                0
                • R Rein Hillmann

                  I know that this is quite a heated debate and I was always on the "Tabs forever" side of the argument but recently I've switched to spaces instead of tabs (due to factors outside of my control) and to be honest, I'm LOVING it. Now I can align all my code the way I like it and not have to worry about the tabs lining up with the parenthesis. What do you guys mostly use? Do your companies have a convention on this?

                  J Offline
                  J Offline
                  Jorgen Sigvardsson
                  wrote on last edited by
                  #49

                  Tabs of course. If God did not wanted us to use tabs to indent, he would have made Bill remove the Tab-key from the Windows keyboards. That being said, I do admit that I only use Tabs for the leftmost columns. If I ever type in some text after a tab, then I will only use spaces. This way the code will look just fine and dandy in any editor and I am not enforcing my tabsize=4 setting anybody who are tabsize!=4. I'm such a nice guy, really. :-) -- "It's a condition of mental divergence, I find myself on the planet Olgo part of a intellectual elite, prepared to subjugate the barbarian hordes on Pluto, but even though this is a totally convincing reality for me in every way, nevertheless Olgo is actually a construct on my psychee. I am mentally divergent in that I am escaping certain unnamed realities that plague my life here."

                  1 Reply Last reply
                  0
                  • T Taka Muraoka

                    People who use tabs should be shot!!!


                    Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.4 (beta)[^]: A free RSS reader with support for Code Project.

                    N Offline
                    N Offline
                    Neville Franks
                    wrote on last edited by
                    #50

                    Taka Muraoka wrote: People who use tabs should be shot!!! With a cannon preferably.:-D Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com

                    1 Reply Last reply
                    0
                    • R Robert Little

                      Spaces. That way I don't have to worry what editor is used, the code will always look the same. --

                      "The money power of the country will endeavor to prolong its rule by preying upon the prejudices of the people until all wealth is concentrated in a few hands and the Republic destroyed." -- Abraham Lincoln

                      A Offline
                      A Offline
                      Avery Moore
                      wrote on last edited by
                      #51

                      Robert Little wrote: Spaces. That way I don't have to worry what editor is used, the code will always look the same. That's the same reason I use spaces.

                      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