News for hackers. Stuff that matters.
Re:Spaces or Tabs? Microsoft developers reveal their prefere... by gabrielsroka on Monday October 12, 2020 @04:35PM (#24759148)
Is there an editor that will format the same code file with different preferences? For example, I use 4 spaces instead of tabs and I don't like extra spaces around (). But my teammate might want 8 spaces or tabs, and extra spaces around ( ).

Why can't we both look at the same file based on our personal preferences and have, for example, GitHub convert it to the approved team standard on check in?

This way, maybe we can end the spaces vs tabs debate once and for all, and make everyone happier.

    if (dense) {
        // mine
    }
or

        if ( spacey ) 
        {
                // theirs
        }
Re:Spaces or Tabs? Microsoft developers reveal their prefere... by vile on Monday October 12, 2020 @06:47PM (#24760357)
Respecting user preferences is, IMO, the major use-case for Tabs - they display indents at the depth of the viewer's preference, not the author's preference.
Re:Spaces or Tabs? Microsoft developers reveal their prefere... by chaorace on Monday October 12, 2020 @05:22PM (#24759582)
The premise of the question is a little flawed. Most people just enforce a specific editor configuration via either a pre-commit git script or a plugin-based solution like editorconfig.

Once the configuration is enforced, you can configure many (most?) code editors to visualize the whitespace as desired (tabwidth/tabstop tend to be the features to look for).