简体   繁体   English

在Web应用程序中管理多种.NET语言

[英]Managing multiple .NET languages in a web application

I am part of a development team building a new ASP.NET 3.5 web application. 我是构建新的ASP.NET 3.5 Web应用程序的开发团队的一员。 Two of us are C# coders, and the other is a VB.NET coder. 我们两个是C#编码器,另一个是VB.NET编码器。

I know that we can mix languages on a per-project basis, and one can build classes in one language that inherit from classes written in the other language in a different project (which we are already doing), but I can see us getting into a situation where we might well end up with cyclic dependencies between our various project DLLs. 我知道我们可以在每个项目的基础上混合语言,并且可以用一种语言构建类,这种语言继承自另一种语言中用不同项目编写的类(我们已经在做),但我可以看到我们进入我们可能最终在各种项目DLL之间存在循环依赖关系的情况。

Other than simply having a high number of projects (more seperation of concerns into more libraries), how have you managed this situation on your own projects? 除了简单地拥有大量项目(更多地关注更多图书馆)之外,您如何在自己的项目中管理这种情况?

Note - I believe this question to be different enough from the only similar match I could find ( this one ) on the basis that we are not wanting to use different languages in order to take advantage of their specific features per se, but rather to make use of what developer resource is available to us (ie one dev just happens to be VB.NET only). 注意 - 我认为这个问题与我能找到的唯一类似的匹配( 这一个 )不同,因为我们不想使用不同的语言来利用它们的特定功能本身,而是制作使用我们可用的开发人员资源(即一个开发者恰好只是VB.NET)。

I got to be honest in saying that I would get the vb.net guy to move to c#. 我说实话,我会让vb.net的人转到c#。

Sooner or later you are going to want him to work on part of the solution that is ac# project. 迟早你会希望他参与ac #project的部分解决方案。 Its an artificial barrier you're creating when transitioning to a new syntax is relatively straight forward. 在转换为新语法时,它正在创建的人工障碍相对简单。

Most developers would welcome the opportunity to transition to c#. 大多数开发人员都欢迎有机会过渡到c#。

I was recently involved in a decision at a major corporate to move to c# from vb.net and we found that this increased morale and was easier to find good candidates. 我最近参与了一家大公司的决定,从vb​​.net转到c#,我们发现这增加了士气,更容易找到好的候选人。

If your shop is predominately C# and that's really what you want your project to be developed in, I would encourage the other developer to learn C# rather than compromising your project to account for lack of knowledge of one of your team members. 如果您的商店主要是C#并且您真正想要开发项目,我会鼓励其他开发人员学习C#而不是为了解决您的项目缺乏对您的团队成员的了解。 That's not to put down your other team member, but if he/she has a good grasp of .Net in general, then there's no reason that this person couldn't learn C#. 这不是要放下你的其他团队成员,但如果他/她一般都很好地掌握.Net,那么这个人就没有理由不能学习C#。

We have a mix of both at my company, however, the choice to use VB.Net always depends on if we are porting an existing VB6 application to .Net, in which case it makes sense to use VB.Net since less code has to be rewritten (in most cases). 我们在我的公司混合使用,但是,使用VB.Net的选择总是取决于我们是否将现有的VB6应用程序移植到.Net,在这种情况下使用VB.Net是有意义的,因为更少的代码必须被重写(在大多数情况下)。

But we'd never let developer skill dictate whether to use C# or VB.Net, we'd choose the best tool for the job, and that should always be the decision point. 但我们永远不会让开发人员的技能决定是使用C#还是VB.Net,我们会选择最适合这项工作的工具,这应该始终是决策点。

I would avoid this if possible. 如果可能,我会避免这种情况。 Try to gave the VB coder improve their C#. 尝试给VB编码器改进他们的C#。 It doesn't have to be immediate, let them write VB for now until they are comfortable with C#, then you may want to go back and refactor the old VB into C#. 它不一定是立即的,让他们现在写VB直到他们对C#感到满意为止,然后你可能想回去并将旧的VB重构为C#。 They are already used to the .NET libraries and tools, it's mostly just the syntax (but yes, there are some language differences). 它们已经习惯了.NET库和工具,它主要只是语法(但是,有一些语言差异)。

The reason I suggest this is for future maintenance - you will have to maintain and debug code in two languages. 我建议这是为了将来的维护 - 你必须用两种语言维护和调试代码。 Not a problem if you all know all languages, but can you ensure this will be the case forever? 如果你们都知道所有语言都不是问题,但你能确保永远这样吗?

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

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