Reputation: 51837
I find VS's default
if(foo)
{
bar();
}
else
{
fizzBuzz();
}
to be incredibly annoying. My personal preference is to have:
if(foo){
bar();
}
else {
fizzBuzz();
}
But some other developers either don't care, or prefer the default.
With version control tools like Hg and Git, you can do a "check out Windows style, check-in GangamUnix style".
I was wondering if there was any way to make my Visual Studio open files with one brace style, and save them with another style?
Upvotes: 0
Views: 78
Reputation: 945
This will always be a matter of preference.
I think what you should do is get together with your developers, talk about it, and decide on one style to go with. Seeing as the other developers don't seem to care that much, chances are high that they will go with your preference.
What you should absolutely try to avoid is that one developer checks out the code, changes the style and checks it in again, only to have it changed back by the other developer.
Also : you can change your prefered style in Resharper, so that it will automatically layout to your preference.
ReSharper -> Options -> C# -> Formatting Style -> Braces Layout
Upvotes: 1