Tab or No Tab :: C++ Compilers

This is a discussion on Tab or No Tab :: C++ Compilers within the C++ Programming forums, part of the General Programming Boards category; Hi, I program using Visual C++, vi, some occassionally using KDevelop. I usually experience problems with tabs and spaces. I ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Tab or No Tab :: C++ Compilers

    Hi,

    I program using Visual C++, vi, some occassionally using KDevelop. I usually experience problems with tabs and spaces. I use tab (3 spaces) in Visual C++. However, vi almost always open the source files with random spaces.

    In general, do developers use spaces instead of tabs?

    Thanks,

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Tabs are way too much and I find code that uses them more difficult to read. When I started I used tabs, then slowly dropped my indention down to two spaces. For some reason I just like the look of
    Code:
    #include <iostream>
    using namespace std;
    
    int main( void )
    {
      int i; 
      for( i = 0; i < 10; ++i ) {
        cout << i << endl;
        i++;
      }
      return EXIT_SUCCESS;
    }
    better than
    Code:
    #include <iostream>
    using namespace std;
    
    int main( void )
    {
          int i; 
          for( i = 0; i < 10; ++i ) {
                cout << i << endl;
                i++;
          }
          return EXIT_SUCCESS;
    }
    It's all a matter of preference, i find it easier to read and type two spaces than to hit the tab key. Though MSVC++ does cause me fits when it wants to indent with tabs and I don't want to.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    129
    I like to add in the beginning of my source code: Best viewed with tab size four. I like to think I'm saving the world when I don't use as much hd space...
    kooma - t.h@iki.fi

  4. #4
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    I like the double space much better.

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    223

    tabs or no tabs

    how the tabs are displayed is to the program (editor) and the settings within that program. That is why I stopped using them....
    zMan

  6. #6
    Registered User
    Join Date
    Feb 2002
    Posts
    14
    IMO I like 3 space tab, makes the code easier to read when I do something stupid so I can look at the blocks of code...all in your own personal opinion is what matters =)

    James

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. tab control
    By tyouk in forum Windows Programming
    Replies: 6
    Last Post: 02-07-2005, 10:47 PM
  4. Visual C++
    By Golffor1 in forum C++ Programming
    Replies: 1
    Last Post: 08-04-2003, 04:30 PM
  5. Disable a tab in control tab?
    By Iron Mike in forum Windows Programming
    Replies: 1
    Last Post: 07-23-2003, 10:50 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21