Tuesday, December 22, 2009

Tabs or Spaces

Some programmers have strong opinions about whether to use tabs or spaces to indent code.
This is what I use. In Visual Studio 2010 choose
Tools\Options\Text Editor\All Languages
Select Smart Indenting
Tab size and Indent size = 4
Select "Keep Tabs"
If you use Shift+Tab when in front of 4 spaces, it will delete the 4 spaces the same as if you press backspace in front of a tab character.
To convert a file one way or another there is "Tabify Selected Lines" and "Untabify Selected Lines" under the Edit\Advanced menu.

No comments: