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

15 of 390 comments (clear)

  1. This is news at any level how? by Foredecker · · Score: 5, Insightful

    This tab thing makes Slashdot front page and the following didnt? Windows 7 way hotter than Vista off the line, now more popular than all OS X versions. Okay then...

    How is this tab things news or interesting at all? Here is what Brittany Behrens a PM for the editor team said:

    Hi Brien,

    Thank you for logging this issue. Before making this change we solicited feedback on the decision to combine Tab Size and Indent Size from a wide variety of sources, including public blog posts and forum threads, and found that the vast majority of user feedback was in favor of combining the two. If its seriously impacting your code to have Tab Size always equal Indent Size, it is possible to write a short editor extension to override the Tools->Options dialog and set the two options separately. If thats something youd be interested in, please let me know and Ill see about posting sample code for how to do this.

    Im resolving this issue as By Design because we intentionally combined these options for VS 2010, but please feel free to post again here if you have any further questions or comments and well be happy to help.

    Thanks for trying Visual Studio 2010 Beta 2 and sending your feedback!

    Brittany Behrens

    Program Manager, VS Platform - Editor

    (bolding above mine for emphasis)

    Gee, the team solicited comments, did some research and made a change that people wanted. Of course, any change will make somebody unhappy.

    Brittany even volunteered to give folks a simple editor extension to make the settings different for those that want it. My assumption is that anyone using Visual Studio is a developer and capeable of using such an extension, or writing it themselves. It is not difficult.

    -Foredecker

    --
    Jibe!
    1. Re:This is news at any level how? by black3d · · Score: 5, Insightful

      This tab thing makes Slashdot front page and the following didnt?

      Windows 7 way hotter than Vista off the line, now more popular than all OS X
      versions

      It's kdawson's shift. He'll never post any article that's even mildly favorable of anything Microsoft related. However, if you can find a story that says some kid in Sweden doesn't like the Windows 7 box-colors, you've got yourself a kdawson front-pager! :)

      --
      "The true measure of a person is how they act when they know they won't get caught." - DSRilk
    2. Re:This is news at any level how? by Wumpus · · Score: 4, Insightful

      No.

      They solicited input from each other and in a blog post that generated a handful of responses. They did this to eliminate "a class of bugs" in the new editor that was triggered by setting the two numbers to different values. Which means they had a bunch of bugs (probably due to confusion between the two settings in the code) and someone had the brilliant idea that the bugs will go away if they just crippled the editor in such a way that the bugs will never be triggered. They solicited input, very quietly, and did it. This also means that the workaround they offer (writing a fucking extension, for fucking crying out loud - what is this, emacs?) will trigger all those bugs because they didn't fix them.

      Idiots.

    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:This is news at any level how? by Rogerborg · · Score: 4, Insightful

      That's a very unfair characterisation; there's much more to kdawson than just Microsoft bashing. Specifically, if you have some shitty snake oil vapourware that you'd like to peddle by shilling an advert thinly disguised as an article, he's your guy.

      --
      If you were blocking sigs, you wouldn't have to read this.
  2. Tabs vs. Spaces by dziman · · Score: 5, Funny

    FIGHT!

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

    They're a meta character, and the meaning can be changed later.

    * If I'm hitting the tab key and it's inserting X spaces, and I hit the key once too many times, I have to hit delete X times instead of just once.

    * If the code is reused in a new environment where everyone wants their indentation levels at 4 spaces instead of 2 or 3 or 8, you have to reformat a lot of code manually. If tabs are used, remap the sizing of the tab character and you're done.

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

  4. Re:Why put tabs in code anyway? by yvajj · · Score: 5, Insightful

    The biggest benefit to tabs (especially if you code in a corporate environment) is that people can view the code based on *their* preferred indentation / spacing e,.g. I may like my tabs to be 2 spaces, another developer may prefer 3 or 4 spaces.

    By setting up their IDE / editor to their preferred tab width, the code indents to the way they like it.

    By forcing all your tabs to be spaces, anyone else viewing the code will be forced to view / edit it in your indentation.

  5. Anyone, anyone? by Blakey+Rat · · Score: 5, Funny

    Ending sentence fragments with anyone, anyone? Does anyone like this convention, anyone? Can we just see it die horribly in flames, anyone?

  6. Re:Why put tabs in code anyway? by nmb3000 · · Score: 5, Insightful

    So, for all those tab fans, what is it about tabs that you find useful?

    1. I can have my indent be 2 spaces and you can have it be 8 spaces, all without changing the source code.
    2. Files are not constantly being changed and updated in the source control system due to the number of spaces changing as different developers edit the code.
    3. If I want to print out a section of code, I can modify the tab/space equivalency so that the lines easily fit on the page without wrapping.
    4. Tabs provide a one-to-one relationship between the level of indentation and the number of characters used. This isn't usually a big deal, but in terms of parsing and editing I personally find this more elegant than using spaces (an inconsistent many-to-one relationship).
    5. It saves electrons. One tab character generally fills the shoes of four space characters. That's a savings of 75%! Smaller storage and transmission requirements means fewer servers in the datacenter which means less heat created which means smaller refrigeration units which means less energy consumed which means fewer greenhouse gases emitted which means less global warming which means continued survival of the human species.

    So there you go. In addition to just being more manageable and flexible, using tabs over spaces will help ensure the future existence of the human species on this planet.

    Okay, so while the last point was in jest (mostly ;), I stand by the first four. Honestly, I've yet to see any pro-spaces people give any substantial reasons (when applied to modern computers and development tools) that spaces work better than tabs.

    So, for all those space fans, what is it about spaces that you find useful?

    --
    "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
    /)
  7. Re:Visual Python by broken_chaos · · Score: 4, Funny

    import psychic

    You can then retrieve the exact number of tabs the last editor to that block/line of code had in mind when they wrote it. This does add a bit of overhead, mind you, such as needing a pint of goat's blood every time you run the program.

  8. Re:Why put tabs in code anyway? by harryjohnston · · Score: 4, Insightful

    I find the use of spaces irritating and stupid, to be equally blunt. I mean, the tab is a character that exists _specifically_ for aligning text. It behaves predictably across editors [...]

    Not in my experience it doesn't!

    You never have to worry about half indents choking the editor.

    I don't understand what you mean by this.

    Why replace tabs with spaces? So you can hit the space bar a thousand times whenever you need to edit something outside a programming editor?

    Ironically, one of the reasons I prefer to use spaces is so that the code is readable when I do want to edit (or view) something outside of the programming editor. Code with tabs in it is usually completely messed up.

    Ah, well, it'd be a funny old world if we were all the same!

  9. Re:Why put tabs in code anyway? by nmb3000 · · Score: 4, Insightful

    I know it's bad form to reply to yourself, but really Slashdot? THAT is how you render an HTML ordered list? What blind, drunk monkey on an acid trip designed that stylesheet?

    Of course the icing on the cake is that in the preview it was properly rendered as an ordered numeric list. WTF, Taco?

    Oh, look at the name of the CSS files responsible: idlecore-tidied.css. Makes sense now I suppose. Anything to do with idle.slashdot is already horribly broken.

    --
    "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
    /)
  10. Comment removed by account_deleted · · Score: 4, Insightful

    Comment removed based on user account deletion

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