Forgot your password?
typodupeerror
Microsoft Programming

Visual Studio 2010 Forces Tab Indenting 390

Posted by kdawson
from the one-man's-readable dept.
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?"
This discussion has been archived. No new comments can be posted.

Visual Studio 2010 Forces Tab Indenting

Comments Filter:
  • by Col. Klink (retired) (11632) on Monday January 25, 2010 @12:40AM (#30886440)

    Did you read the blog post [msdn.com] where they solicited feedback? It had 9 comments in total. Among them was this comment from the author of the blog (4th comment):

    I assure you we won't be changing that option [tab vs spaces] any time soon :-)

    So they solicited comments on a blog that no one reads and immediately say they aren't planning to change anything when questioned. After saying they wouldn't be changing the option, no one complained. Wow, what due diligence.

  • by weicco (645927) on Monday January 25, 2010 @01:02AM (#30886554)

    I'm doubtful that giving an invisible character semantic meaning is wise

    (In the voice of dr. Farnsworth) Yes, yes. Let's all forget about those nasty invisible characters like \r \n and especially \0

  • by cgenman (325138) on Monday January 25, 2010 @01:02AM (#30886556) Homepage

    This tab thing makes Slashdot front page and the following didn't?

    Of course the tab thing made Slashdot front page. Some people here virtually LIVE in Visual Studio, and code indentation is a heavily entrenched basic function of coding that people get surprisingly fired up about. Even if this particular aspect of code indentation isn't going to effect people, it's just begging for a heated emacs level discussion.

    Your article, on the other hand, basically confirms that people like Windows 7 more than Vista, and that Windows 7 continues the well known and understood tradition of Windows outselling OSX by a factor of 10 to 1. These are things we already knew. Also, the article you site isn't even the source of the information, but refers to a much better Ars Technica article, which itself gets the data from Net Applications. I wonder if you didn't link the Ars Technica [arstechnica.com] article directly because it claims that "Linux was the only operating system [in December] to show positive percentage growth in market share." Or maybe this one "When putting this into perspective across the whole year, though, we see that Windows was actually sliding steadily throughout 2009 (93.66 percent in January 2009), while both Mac OS (4.71 percent in January 2009) and Linux (0.90 percent in January 2009) have been gaining." Or maybe the fact that Windows XP continues to hold onto 2/3rds of the active Windows installbase.

    Also, it might be nice to point out that you're work at Microsoft in the Windows org as a development manger. It would boost your credibility as a poster, and reduce potential conflicts of interest.

  • by poopdeville (841677) on Monday January 25, 2010 @01:32AM (#30886678)

    * The tab character itself has some semantic meaning - indent. The space is a word and symbol separator. Use an indentation character when you want to indicate indentation.

    No, it doesn't mean "indent". It means "tabulate". You shouldn't be using tab to indicate indentation. You should use tab align table columns -- i.e., to indicate tabulation.

  • by poopdeville (841677) on Monday January 25, 2010 @02:43AM (#30887080)

    If \r and \n are "visible", then so is \t.

  • TABs are for TABles! (Score:5, Informative)

    by mangu (126918) on Monday January 25, 2010 @05:11AM (#30887806)

    when I open the file my editor represents the tabs as width as two spaces, while my colleague uses a four-spaces-for-tabs setting as he prefer that way.

    And then comes another guy who uses three spaces to indent and your code is gone. Allowing each user to change arbitrarily the width of the TAB is a BAD idea.

    The original use of the TAB key was to ease the creation of tables in typewriters. There was a set of mechanical stops, one for each column, and you could set or reset each stop. Pressing the TAB key moved the carriage to the next stop. Some electronic terminals, like the VT-100 for instance, kept this convention, allowing one to set or reset the TAB stop for each column. In modern computers this is not really necessary, since editing tables is often done in spreadsheets.

    Setting the TAB width arbitrarily at fixed multiples of eight or any other number of columns really doesn't help much, since the indentation support of modern editors is much more powerful than that.

    The only use of the TAB key for me is moving to the next widget in the GUI.

  • Re:#include "less.h" (Score:3, Informative)

    by ljaguar (245365) on Monday January 25, 2010 @06:47AM (#30888268) Homepage Journal

    vim already does exactly this. http://vim.wikia.com/wiki/Modeline_magic [wikia.com]

    it looks like this. (ts = tabstop, sw=shiftwidth) // vim: noai:ts=4:sw=4
          -or- /* vim: noai:ts=4:sw=4
    */
          -or- /* vim: set noai ts=4 sw=4: */
          -or- /* vim: set fdm=expr fde=getline(v\:lnum)=~'{'?'>1'\:'1': */

    so using your example: /* MS_VC_INTENT=2; MS_VC_TAB=4 */

    if you put on top of your file, // vim: set tabstop=4 shiftwidth=2

    then vim will do the correct thing.

  • by gazbo (517111) on Monday January 25, 2010 @06:57AM (#30888304)
    But you wouldn't use tabs for that. You would use tabs to indent to the current level, and then spaces for formatting. In the example you showed where everything is at the top level, there would be no tabs at all.
  • by mqduck (232646) <`mqduck' `at' `mqduck.net'> on Monday January 25, 2010 @07:15AM (#30888434)

    I see an ordered, numeric list. What are you seeing?

  • by Anonymous Coward on Monday January 25, 2010 @07:57AM (#30888662)

    It doesn't have to be invisible so i don't know what you are complaining about.

  • by killmenow (184444) on Monday January 25, 2010 @08:40AM (#30888980)

    Subject: ASSERTION

    Body: NOTHING RELATED TO ASSERTION

    You assert Windows 7 sucks but have nothing in your post's body to suggest why you assert this. I would like to know what's so bad about Windows 7 (other than it being a closed-source proprietary operating system).

    Because...I hate Microsoft's business practices. I hate the unethical behavior of the company's directors and executives. I hate many of their products because many of their products are de facto industry standards despite being demonstrably garbage. But I'm running Windows 7 Pro x64 now and you know what? I hate that I like it so much. Unlike the vomit-inducing Vista, Win7 does everything I want and feels as good with resources as XP, runs all the Windows specific apps I need without anally raping me with a bottle of WINE, drives multiple monitors without a hitch, has a sensible audio subsystem, a clipboard system that isn't all over the place, and runs VirtualBox with any and every Linux guest OS I need without as much as a hiccup.

    Sure, YMMV but IMHO 64-bit Windows 7 is absolutely the best operating system ever to come out of Redmond, WA. Is it perfect? Of course not. There's no such thing as a perfect OS. But I think it's pretty damn good. And this disturbs me.

    So please help me hate Windows 7. I feel dirty.

  • by Waffle Iron (339739) on Monday January 25, 2010 @09:15AM (#30889338)

    0.90 to 1.02 isn't particularly impressive. 0.00 to 5.71 is.

    It's not all that impressive if you've already enlisted every single PC OEM as your personal towel boy.

  • by smellotron (1039250) on Monday January 25, 2010 @09:15AM (#30889346)
    Sorry, there's probably a better phrase for what I'm trying to describe, and /. is mangling my attempt at ASCII art. Replace these underscores with spaces and you'll see the effect I'm going for. When L (and most characters in a fixed-pitch font) is the leading character in a line, it is visually as far-to-the-left as possible. However, some other characters (|ijf) will be centered, giving the appearance of being shifted slightly to the right. If the only indentation is a single space, the distinction between "real" indentation and leading whitespace inside the character's region is fairly small.

    L
    _L
    __L
    ___L
    ____L
    ____L
    ____L
    ____L
    ____L
    __|

    If you use more spaces for an indent level, even a dead, beaten horse could easily identify the nesting level.

    L
    __L
    ____L
    ______L
    ________L
    ________L
    ________L
    ________L
    ________L
    ____|

  • by maxume (22995) on Monday January 25, 2010 @10:55AM (#30890974)

    You read it wrong, the only thing he left out was attribution, it isn't some big sekrit:

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=517188&wa=wsignin1.0 [microsoft.com]

God doesn't play dice. -- Albert Einstein

Working...