Insert spaces vs. Keep tabs


Menu:  Tools -> Options -> Text Editor -> [Language] -> Tabs
Versions:  2008,2010
Published:  9/8/2010
Code:  vstipEdit0072

 

Make sure to check out the Windows Phone Developer Portal

 

Some people like tabs in their code and others are more fond of spaces.  You can specify what you want by going to Tools -> Options -> Text Editor -> [Language] -> Tabs:

image

 

Tab size-sets the distance in spaces between tab stops. The default is four spaces.  Every time you hit the TAB key it will advance the number of spaces specified. 
 

Indent size-sets the size in spaces of an automatic indentation. The default is four spaces. Tab characters, space characters, or both will be inserted to fill the specified size.  When the editor automatically indents your code it will use this setting to determine how much space to use. 
 

Insert spaces-indent operations insert only space characters, not TAB characters. If the Indent size is set to 5, for example, then five space characters are inserted whenever you press the TAB key or the Increase Indent button on the Formatting toolbar:

image

 

Keep tabs-indent operations insert TAB characters. Each TAB character fills the number of spaces specified in Tab size. If the Indent size is not an even multiple of the Tab size, space characters are added to fill in the difference:

 

 

image

Comments (3)

  1. thank you mr obvious says:

    The question is the a better solution

    spaces or tabs?

  2. zainnab says:

    Yeah…so…that's up to you. Everyone has a preference but I can't predict what your preference will be.

    Your Friend,

    Mr. Obvious 🙂

Skip to main content