Slashdot Mirror


Visual Studio 2010 Forces Tab Indenting

An anonymous reader writes "For years, Microsoft has allowed Visual Studio users to define arbitrary tab widths, often to the dismay of those viewing the resultant code in other editors. With VS 2010, it appears that they have taken the next step of forcing tab width to be the same as the indent size in code. Two-space tabs anyone?"

2 of 390 comments (clear)

  1. This is bad by mysidia · · Score: 1, Flamebait

    It's an example of Microsoft imposing a policy decision on users of the software. Some of them don't want this, but they're going to be forced to do it this way because Microsoft is defining a tab policy

    The problem with this is.... old code, created with different settings in VS 2008 or earlier.

    And the need to be able to open it in VS 2010 and actually make sense out of it.

    E.g. backwards compatibility.

    Also, configurability of tab width and indent width is probably a good thing.

    If the other editors can't config tab width, they suck.

    Obviously companies and developers using the software should have coding standards that specify what tab width and indent width to use (normally 4 spaces)

    But still, regardless of software used, the number of spaces to use for a tab is a policy thing, that should be dictated by the developer(s) or their company.

  2. Re:Why put tabs in code anyway? by Blakey+Rat · · Score: 0, Flamebait

    Well, your editor sucks. There's really no way around it.

    If you set Visual Studio (the editor we're talking about in this thread) into tabs mode, it'll *never* insert spaces. Not unless you hit the space bar.

    One of the things that bothers me is that if you set tab to use spaces, it becomes some weird special-case key, treated differently than every other key on the keyboard. If I type the key labeled "A", I get an "A" character in my document. If I type the key labeled "Space", I get a space character in my document. If I type the key labeled "Tab", I get a "Tab" character in my document. Why make things hard?

    (Also I don't like seeing eight-character indentation when I need to view the file from the command line or in notepad, but that's a minor point.)

    Why would you *ever* view a code file from Notepad?