|
-
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,
Kuphryn
-
Reef Shark
Usually use spaces. Tabs can always screw up when you move the code to a different editor or machine. Most of editors now support an option to change the tabs to spaces.
-
Here's my advice. You can use tabs or spaces (or a combination of both, as vi will do with ^T and shiftwidth), BUT a TAB is eight spaces. Always. Do not screw with that unless you absolutely have to (i.e. director of the project tells you to).
-
Thanks everyone.
I set Visual C++ to use *spaces* when I hit the tab key. This method works great. Thanks!
Kuphryn
-
NullPointerException
I'd say always use spaces. As implied above, TABs are sometimes different spaces - either in different software or on different OSes. (usually 4 or 8, though).
Since many editors won't show you what's a tab or space, it's much safer to just stick to spaces. Reading through our source code, it's obvious when 2 people have been in a file and used different editors... Very ugly.
Besides, indenting with 3-space increments looks so much better, especially when sticking to 80-character lines. Otherwise you end up with a column down the right margin :P
------------------
The price of freedom is high.
Open Source is free like a puppy is free.
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames.
Understanding Evolution
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|