Coding Styles

Dec 19, 2011 at 5:17 PM

In preparation for submitting a bug fix I was reading up on the nuget coding guidelines.  

http://docs.nuget.org/docs/contribute/coding-guidelines

It seems though that a large portion of the nuget code base doesn't follow the established guidelines.  In particular the location of braces is specified as on the same line as the statement which begins the block.  This seems to be violated in a very large portion of the code base.  

Has the official accepted style changed and the documentation is simply lagging behind?  

The particular bug I'm working on requires changes to WpfConsole.cs and WpfConsoleService.cs neither of which follows this guideline.  So far I've been taking the approach of "maintain the style present in the file I'm editing."  This seems to be the best approach.

Developer
Dec 19, 2011 at 5:22 PM
jaredpar wrote:

Has the official accepted style changed and the documentation is simply lagging behind?  

Yes. We realized that the vast majority of people outside of our team were using VS defaults as their coding style and formatting ended up being a nuisance when doing code reviews from external contributors and accepting pull requests. This particular section of the docs hasn't been updated in a while.

Dec 19, 2011 at 5:30 PM

Thanks for veriyfing that!

I'll stay on my current path of just maintaining the style of the file in which I'm making a bug fix.

Coordinator
Dec 19, 2011 at 11:44 PM

I updated the documentation. Thanks for pointing out the discrepancy! :)