4 ms·
Opening brace on a new line is the default, but VS has excellent granular settings in this area. I was tired of having different standards for C and C#, so at o
by shoover 9y ago
Opening brace on a new line is the default, but VS has excellent granular settings in this area. I was tired of having different standards for C and C#, so at one point we switched our defaults and ran a utility to convert all our C# code. We use a new line for namespaces, classes, and methods and the same line for everything else. VS handles it flawlessly and we haven’t looked back. Thinking back, I have not seen any inconsistencies committed in that time. VS autoformat is that good, with braces and white space.
- omgtehlion 9y ago> a new line for namespaces, classes, and methods and the same line for everything else accidentally, we arrived to the same code style for both C# and C++...
- shoover 9y agoProbably accidental here, too, in that the C code was older and larger. There was no good answer for the question of why C# was different, so the change was made. The only downside would be if I worked on someone else’s project with different standards. I don’t think VS can figure out autoformat at the project level, like, say, python mode in emacs.