View Poll Results: To TAB or not to TAB (Code Indentation)

44. You may not vote on this poll
  • Use Tabs

    25 56.82%
  • Use Spaces

    19 43.18%

Thread: To TAB or not to TAB...

  1. #1
    Registered User BillBoeBaggins's Avatar
    Join Date
    Oct 2003

    To TAB or not to TAB...

    If you use tabs as a rule
    If you use spaces as a rule

    (in regards to code indentation)

  2. #2
    Registered User axon's Avatar
    Join Date
    Feb 2003
    I always use TAB in code. It is much simpler, less key strokes, and cleaner looking.

    some entropy with that sink?

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  3. #3
    Banned nickname_changed's Avatar
    Join Date
    Feb 2003
    I use tabs, but have them replaced with spaces (5), so they look the same on all file editors.

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    ^ that's what I do... plus, when I have to use spaces, I always misalign by a space or so... and when you start nesting more and more stuff, you (I) spend way too much time worrying about exact spacing...
    Join is in our Unofficial Cprog IRC channel
    Channel: #Tech

    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  5. #5
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Spaces. I turn on the "turn tabs into spaces" option in VC++7.1 and set tabs to 2 spaces.


    Because tabs cause all sorts of problems with porting to other IDEs. If you are using one IDE which has tabs set to a certain size but are using code from multiple sources which uses tabs set at other sizes then the formatting goes to hell! Not all IDEs use the same tabbing size by default. Not only that, but on all IDEs I've used, default tabbing is set to be too high anyways (they are usually set to between 4 and 6 spaces wide). If you use the "convert tabs to spaces" option (which inserts spaces instead of tabs when you use the tab key) when you are coding, then this problem never occurs. You are guaranteed that your code will be formatted exactly the way you want it no matter who uses it on whichever IDE they choose.

  6. #6
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Two spaces is what I use.

  7. #7
    Join Date
    Jun 2003
    My editor mostly does the tabbing for me in a spiffy auto check feature.
    "When I die I want to pass peacefully in my sleep like my grandfather did, not screaming and yelling like the passengers in his car."

  8. #8
    Registered User dirkduck's Avatar
    Join Date
    Aug 2001
    I use tabs myself, seems a lot easier than hitting space five times.

  9. #9
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    I use tabs.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.

    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  10. #10
    Board Conservative UnregdRegd's Avatar
    Join Date
    Jul 2003
    I use spaces, too, for reasons already mentioned. I sometimes wonder how a person can use tabs instead of spaces and still call themselves human!
    I am a programmer. My first duty is to God, then to nation, then to employer, then to family, then to friends, then to computer, and finally to myself. I code with dignity, honor, and integrity.

  11. #11
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Two spaces... If auto-indent is available with spaces, I use that (set to 2, of course).
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  12. #12
    Still A Registered User DISGUISED's Avatar
    Join Date
    Aug 2001
    I use spaces because that is what I am told to use.

  13. #13
    Registered User
    Join Date
    Nov 2002
    tabs to spaces option with it set to 2 spaces.

  14. #14
    Emotionally Unstable DarkViper's Avatar
    Join Date
    Oct 2002
    TABed, because its less tedious and is good practice if you script in other languages as well.
    ~DJ DarkViper signing out
    My Site:
    Black Jaguar Studios

    Fluent English, Starter German, HTML, Javascript, Actionscript, Intermediate PHP

    Verteran Despiser of: ASP, Java, BASIC, Pascal, Cobalt

  15. #15
    Registered User kinghajj's Avatar
    Join Date
    Jun 2003
    2 space tabs? Wow! I use 8-space tabs! That does make the code long vertically, but it looks cleaner to me.

    though, some of my editor's use 4-space tabs

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Tab Ordering of GUI Controls
    By cloudy in forum Windows Programming
    Replies: 2
    Last Post: 04-22-2006, 09:13 AM
  2. Tab order in Tab Control
    By Halloko in forum Windows Programming
    Replies: 2
    Last Post: 05-08-2005, 11:08 PM
  3. Visual C++
    By Golffor1 in forum C++ Programming
    Replies: 1
    Last Post: 08-04-2003, 04:30 PM
  4. Disable a tab in control tab?
    By Iron Mike in forum Windows Programming
    Replies: 1
    Last Post: 07-23-2003, 10:50 AM
  5. Tab controls - MFC (revived)
    By Robert602 in forum Windows Programming
    Replies: 1
    Last Post: 01-22-2002, 12:32 PM