简体   繁体   English

.NET团队 - 最佳实践和方法

[英].NET Team - Best Practices and Methods

What best practices and methods would you enforce on a new .NET development team? 您将在新的.NET开发团队中实施哪些最佳实践和方法?

Cheers 干杯

  • Use only Visual Studio 仅使用Visual Studio
  • If you need a database, use a server (reduces SQL issues early on) 如果需要数据库,请使用服务器(尽早减少SQL问题)
  • Use Version Control 使用版本控制

Update 更新

MSDN - Design Guidelines for Class Library Developers - All Versions MSDN - 类库开发人员的设计指南 - 所有版本

I had also assumed the OP was referencing coding standards. 我还假设OP正在引用编码标准。 As for the more general practices. 至于更一般的做法。

  • Unified Development Environment (Visual Studio will probably net the best results) 统一开发环境(Visual Studio可能会获得最佳结果)
  • Version Control ( Team Foundation Server is great if you can afford it, if not SVN ) 版本控制(如果你负担得起, Team Foundation Server很棒,如果不是SVN的话
  • Team Collaboration ( Trac if you go with SVN , TFS has some stuff as well) 团队协作( Trac,如果你选择SVN ,TFS也有一些东西)

Good question. 好问题。 I've had to deal with this very recently with my team. 我最近不得不和我的团队打交道。 Here's a couple quick points: 这里有几个快速点:

  • Come up with coding and documentation standards. 提出编码和文档标准。 A search for C# style guidelines will yield some good results. 搜索C#样式指南将产生一些好的结果。 StyleCop and FxCop might be useful for enforcing your standards. StyleCop和FxCop可能对执行您的标准很有用。
  • Source control. 来源控制。 SVN is popular, but I prefer Mercurial. SVN很受欢迎,但我更喜欢Mercurial。
  • Depending upon what type of projects you are working on, you might want to decide on a standard architecture. 根据您正在处理的项目类型,您可能希望决定标准体系结构。 Typically, we use a UI - Application - Business Logic - Infrastructure architecture. 通常,我们使用UI - 应用程序 - 业务逻辑 - 基础架构架构。
  • Put your database in version control. 将数据库置于版本控制中。

You are asking for a shelf of books. 你要书架。 I don't think you'd want to read an answer long enough to actually cover what you asked. 我认为你不想长时间阅读答案,实际上涵盖了你的要求。

Microsoft's Patterns & Practices group may have some suggestions that could be useful as a resource of where are some good practices. Microsoft的模式和实践小组可能会提供一些建议,这些建议可以作为一些良好实践的资源。

Continuous Integration would be another practice I'd introduce along with Technical Debt . 持续整合将是我与技术债务一起引入的另一种做法。

I'd review various Agile practices and see what the team thinks are worth adopting and what isn't. 我将回顾各种敏捷实践 ,看看团队认为值得采用的是什么,什么不是。 Tribal Leadership would also be something I'd examine to see what stage is the tribe and try to bring it to stage 4 if possible. 部落领导也是我要检查的部分,看看部落是什么阶段,如果可能的话,尽量把它带到第4阶段。

If I could put some values into the team it would be to have some pride in our work, respect one another, and think of things in terms of good for the team rather than individual gain. 如果我能够为团队赋予一些价值,那就是对我们的工作感到自豪,彼此尊重,并且考虑到对团队有利而不是个人利益的事情。 Granted that culture wasn't part of the question it is a natural follow-up to my mind. 认为文化不是问题的一部分,这是我心中的自然后续行动。

You need to use version control (svn is great), but at the same time you shouldn't check everything into the sourcecontrol. 你需要使用版本控制(svn很棒),但同时你不应该检查sourcecontrol中的所有内容 skip checking in compilation output and configuration files, instead check in the config files as app.config.template files and have each dev make his own copy of the config files called app.config. 跳过检查编译输出和配置文件,而不是将配置文件作为app.config.template文件检入,并让每个开发人员自己创建名为app.config的配置文件副本。 check in new changes to the .template file and have all devs regularly check and update their local version if it changes. 检查.template文件的新更改,并让所有开发人员定期检查并更新其本地版本(如果更改)。

If possible, pair up junior members with more senior members. 如果可能的话,将初级会员与更高级的会员配对。 Either way, definitely have code reviews. 无论哪种方式,绝对有代码审查。 I'd also encourage them to have scheduled workshops or discussions so that they can get more well-rounded skills and to increase their exposure to different areas that they might not currently be aware of. 我还鼓励他们安排研讨会或讨论,以便他们能够获得更全面的技能,并增加他们可能不会意识到的不同领域的风险。

I'd also encourage them to go to user group meetings. 我也鼓励他们去参加用户组会议。

I would start by looking through the MSDN Developer Centers site: 我将首先浏览MSDN开发人员中心网站:

http://msdn.microsoft.com/en-us/aa937802.aspx http://msdn.microsoft.com/en-us/aa937802.aspx

Since you are using C# I would recommend using StyleCop to maintain consistency in code layout. 由于您使用的是C#,我建议使用StyleCop来保持代码布局的一致性。 Since you've stated it's a new team, I'm assuming that the code base is new as well. 既然你说它是一个新的团队,我假设代码库也是新的。 Starting fresh with StyleCop is far easier than trying to get rid of warnings in an existing code base. 使用StyleCop重新开始比尝试摆脱现有代码库中的警告要容易得多。

most people would agree that having automated unit tests is a very good thing. 大多数人会同意自动单元测试是一件非常好的事情。 you may want to go the tdd route and never code anything that doesn't already have a test, or you may want to write tests after the code and just focus on the key areas of concern rather than striving for 100% coverage. 你可能想要去tdd路线并且从不编码任何没有测试的东西,或者你可能想要在代码之后编写测试,只关注关注的关键领域而不是争取100%的覆盖率。 either way, decide what you want to achieve with testing and make sure that it is adhered to. 无论哪种方式,通过测试确定您想要达到的目标,并确保遵守。 without a strict law on getting unit tests you may well find that some if not all of your code has no automated tests and the only way that code gets tested is when someone goes into the UI and actually uses it. 如果没有严格的单元测试法则,您可能会发现一些(如果不是全部)代码都没有自动化测试,而且代码测试的唯一方法就是有人进入UI并实际使用它。

In no particular order, 没有特别的顺序,

  • Agile / Scrum 敏捷/ Scrum
  • A nice suite of tools -Resharper, Redgate SQL Tools, FXCop,etc. 一套很好的工具-Resharper,Redgate SQL Tools,FXCop等。
  • Test Driven Development 测试驱动开发
  • Continuous Integration 持续集成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM