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

Spaces vs. Tabs

Scheduled Pinned Locked Moved The Lounge
visual-studioarchitecturequestion
25 Posts 18 Posters 38 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.
  • P Paul Lyons

    Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson

    C Offline
    C Offline
    CodeGuy
    wrote on last edited by
    #21

    I'm surprised no one has mentioned the main problem with tabs ... they may look great on your screen, but they totally wreak havoc with printouts. CodeGuy The WTL newsgroup: 970 members and growing ... http://groups.yahoo.com/group/wtl

    1 Reply Last reply
    0
    • P Paul Lyons

      Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson

      J Offline
      J Offline
      John Fisher
      wrote on last edited by
      #22

      So,   With all of these wonderful opinions, why hasn't someone already written an editor that treats all whitespace before the start of line as tabs or spaces (depending upon developer preference), and indents things according to developer preference? It could then be capable of saving the files with space/tab settings that match any relevant code guidelines, without the developer having to care about it.   I know there are code formatting tools, but someone's got to have invented an editor that will do that sort of thing at load time, right? John

      1 Reply Last reply
      0
      • P peterchen

        The absolute proof for Paul Watson's statement....

        P Offline
        P Offline
        Paul Watson
        wrote on last edited by
        #23

        :-D Exactly, someone could probably make a religious war out of Tabs vs. Spaces. regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge "In other words, the developer is dealing with an elephant, the accountant is dealing with a bunny rabbit." by Stan Shannon - 16/10/2001

        1 Reply Last reply
        0
        • P Paul Lyons

          Color me ignorant :confused:! Why are some people so vigorously opposed to tabs in source code? I came accross this statement at someones "MVP" website... "people who insist on using tabs to layout their code (i.e. bozos)".:mad: <-ouch that's harsh!-> What are the advantages of spaces versus the disadvantages of tabs? "Do not go where the path may lead, go instead where there is no path and leave a trail." - Ralph Waldo Emerson

          P Offline
          P Offline
          Paul Watson
          wrote on last edited by
          #24

          I vote for tabs. Main reason being that with tabs it is then easy in any professional code editor to set how many "spaces" a tab is equal to. I like to only indent by 1 space, makes my code easy to read as opposed to 4 or 8 spaces. But a fellow developer likes to use 4 spaces for indenting. If I used spaces instead of tabs then my fellow developer would have to stick with my 1-space indenting or change it all himself. CodeGuy says that tabs are bad for printing... well personally the number of times I have printed code vs the number of times I have seen other peoples code onscreen is heavily in the laters favour. So I vote for tabs. You are not ignorant, just butting your head against old standards with no place in our modern days :-D regards, Paul Watson Bluegrass Cape Town, South Africa "The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge "In other words, the developer is dealing with an elephant, the accountant is dealing with a bunny rabbit." by Stan Shannon - 16/10/2001

          1 Reply Last reply
          0
          • X Xian

            If you like a certain tab feel then when you start set your "Tabs are Spaces" if you use Visual Studio, then set it to what you want. Let us say 2, as I do. Then when you are done coding you can go and click Edit->Advanced->Tabify and it will change all of your groups of 2 spaces to tabs (I believe it does all of them, maybe just leading...I dont know). Then when you distribute your code (if you care) then whoever maintains it can see it how they want. That way you don't end up with the "mix" of spaces and tabs that I *ALWAYS* end up with when I dont set tabs to spaces. ;P Plus - I like to open my .cpp files in Notepad from time to time and as we all know the tabs in notepad are 8 wide, and most of my code gets scrolled. That angers me! :mad: Peace! ---- Xian

            S Offline
            S Offline
            Simon Capewell
            wrote on last edited by
            #25

            Try replacing notepad with metapad. It's much smaller than wordpad and you can customize the tab size.

            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