Welcome to MSDN Blogs Sign in | Join | Help

Sara Ford's Weblog

My adventures embracing open source on CodePlex and at Microsoft

News

    • Did you know... All author proceeds go directly to sending Hurricane Katrina survivors to college.

      Microsoft Visual Studio Tips book

      Recent Entries

Did you know... How to keep tabs or to insert spaces? - #102

This tip and yesterday's tip were my least favorite features to test.  It would just drive me crazy trying to keep up with when should a tab get inserted, when should the cursor move to the correct formatted position, etc.  Now, i will only use spaces in my code.  =)

Go to Tools - Options - Text Editor - <Language> - Tabs to switch between using tabs or to insert spaces instead.

Keep Tabs Or Insert Spaces options

Note that you can set this for all languages on the Text Editor - All Languages page, but usually this is something you may want to set for each individual language.

Additionally, check out an earlier tip on how to convert tabs to spaces and spaces to tabs.

Technorati tags: ,
Posted: Friday, December 07, 2007 3:00 AM by saraford

Comments

Aaron Stonerock said:

The problem with "Insert Spaces" is if you have members of the same team with different Tab Sizes.  When Developer A with 2 char tab (with spaces) setting, VS will manage to modify the entire file by replacing tabs with spaces.  Developer B then wants to see changes made by Developer A and the VSS diff is worthless due to all these extra changes.  We were better off with "Keep tabs" and let the VS UI handle the rendering of the tab indentation.

# December 7, 2007 12:24 PM

Jason Haley said:

# December 7, 2007 3:57 PM

GregM said:

Aaron, you need a diff program that can be set to ignore whitespace.  We switched to spaces a long time ago because it makes things so much easier to deal with, especially when you deal with third-party code with different tab sizes.

# December 8, 2007 1:40 PM

True Architect - VM said:

This signals that team/project lead or architect didn't do their job to establish enterprise standards and let inmate developers to run asylum.

# December 10, 2007 9:51 AM

xjb said:

# December 18, 2008 7:41 PM
New Comments to this post are disabled
Page view tracker