是否有开发C#编码标准/最佳实践文件有什么建议?

问题描述:

我刚刚毕业的AI(大约2年)为温和的操作工作。它已跌至我(主要是因为我在系里的第一个收养人)来创建一个基本(读有用吗?)C#编码标准文档。

I'm a recent AI graduate (circa 2 years) working for a modest operation. It has fallen to me (primarily as I'm the first 'adopter' in the department) to create a basic (read useful?) C# coding standards document.

我觉得我应该解释一下,我可能是最初级的软件工程师去,但我期待着这个任务,希望我可能实际上是能够产生一半可用的东西。我已经做了pretty广泛的搜索互联网和阅读什么编码标准文件应该/不包含的文章。这似乎是一个好地方为已任,以寻求一些建议。

I think I should explain that I'm probably the most junior software engineer going, but I'm looking forward to this task as hopefully I might actually be able to produce something half usable. I've done a pretty extensive search of the Internet and read articles on what a coding standards document should / should not contain. This seems like a good as place as any to ask for some suggestions.

我意识到,我可能会打开大门分歧的整个世界关于做事情的最好方法。我都理解和尊重不可否认的事实是每个程序员都有解决每个任务的preferred方法,因此我不希望写东西这么draconianly禁止性的扼杀个人的天赋,但尝试并获得普遍方法和商定的标准(如命名规范),以帮助个人code更具可读性。

I realise that I am potentially opening a door to a whole world of disagreement about 'the best way to do things'. I both understand and respect the undeniable fact that each programmer has a preferred method of solving each individual task, as a result I'm not looking to write anything so draconianly proscriptive as to stifle personal flair but to try and get a general methodology and agreed standards (e.g. naming conventions) to help make individuals code more readable.

所以这里去....有什么建议?任何在所有?

So here goes .... any suggestions? Any at all?

我们先从


  • Microsoft的.NET准则:http://msdn.microsoft.com/en-us/library/ms229042.aspx (链接.NET 4.5更新中)

  • 微软的C#准则:http://blogs.msdn.com/brada/articles/361363.aspx.

  • Microsoft's .NET guidelines: http://msdn.microsoft.com/en-us/library/ms229042.aspx (link updated for .NET 4.5)
  • Microsoft's C# guidelines: http://blogs.msdn.com/brada/articles/361363.aspx.

,然后从文件到该基准的差异和补充。

and then document the differences from and additions to that baseline.