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?"

14 of 390 comments (clear)

  1. Re:This is news at any level how? by Col.+Klink+(retired) · · Score: 3, Informative

    Did you read the blog post 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.

    --

    -- Don't Tase me, bro!

  2. Re:Why put tabs in code anyway? by weicco · · Score: 3, Informative

    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

    --
    You don't know what you don't know.
  3. Re:This is news at any level how? by cgenman · · Score: 5, Informative

    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 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.

  4. Re:Why put tabs in code anyway? by poopdeville · · Score: 3, Informative

    * 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.

    --
    After all, I am strangely colored.
  5. Re:How is newline invisible by poopdeville · · Score: 2, Informative

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

    --
    After all, I am strangely colored.
  6. TABs are for TABles! by mangu · · Score: 4, Informative

    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.

  7. Re:#include "less.h" by ljaguar · · Score: 2, Informative

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

    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.

  8. Re:Why put tabs in code anyway? by gazbo · · Score: 3, Informative

    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.

  9. Re:Why put tabs in code anyway? by mqduck · · Score: 2, Informative

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

    --
    Property is theft.
  10. Re:Why put tabs in code anyway? by Anonymous Coward · · Score: 1, Informative

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

  11. Thoughts on Windows 7 by killmenow · · Score: 2, Informative

    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.

  12. Re:This is news at any level how? by Waffle+Iron · · Score: 3, Informative

    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.

  13. Re:Tabs suck. Use a space. by smellotron · · Score: 3, Informative
    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
    ____|

  14. Re:This is news at any level how? by maxume · · Score: 2, Informative

    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

    --
    Nerd rage is the funniest rage.