移植VB.NET WinForms应用程序到C# [英] Porting VB.NET Winforms Application to C#

查看:114
本文介绍了移植VB.NET WinForms应用程序到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有好的资源用于移植一个VB.NET的WinForms应用到C#?我敢肯定有是,仅仅翻译了code软件,但我希望重构code在同一时间。保持它目前的形式是有问题的,因为它使用了一些糟糕的设计做法VB.NET允许的,并会进一步复杂化保养的未来。有没有人通过这一过程在这里消失了,你怎么去这样做呢?你有没有使用翻译/重构的方法呢?你刚才使用的终端产品来重新创建功能,而不着眼于当前codeBase的大多数呢?请问您(合)建议?

Are there any 'good' resources for porting a VB.NET winforms application to C#? I'm sure there are is software that just translates the code, but I'm looking to refactor the code at the same time. Keeping it in its current form is problematic, since it uses some of the 'bad design' practices that VB.NET allows, and would further complicate future maintanence. Has anyone here gone through that process, and how did you go about doing it? Did you use a translate/refactor approach? Did you just use the end product to recreate functionality without looking at the current codebase for most of it? What would you (collectively) recommend?

更新

当我告诉Grauenwolf,保持其当前语言presents以下问题:

As I was telling Grauenwolf, keeping it in its current language presents the following issues:

  • 在不能够很容易地增加新的功能。 VB.NET是不是我的岩石固体语言,我做的AP preciate学习语言移植过来的讽刺 - 但以后的维护需要考虑的人谁不知道VB。 NET。
  • 应用程序的其他部分已经被移植到C#(很久以前,在事实);我们想补充的所有功能依赖于去耦应用程序(现在它是非常紧密耦合)。我的选择是要么在语言重构它我不是太熟悉,或将重构它在我理解的语言。

要的人谁投赞成票的问题了,我真的不知道的为什么的你做;值得关注的是不是我是否应该留在VB.NET;值得关注的是什么还没有结束,现在移植它的未来价值。如果我要在修复它不遗余力巨大的代价,为什么不走额外的步骤,使之维护为未来的程序员?

To anyone who voted the question down, I'm not really sure why you did; the concern isn't whether I should leave it in VB.NET; the concern is what is the future cost of not porting it over now. If I'm going to spare great expense in fixing it, why not go the extra step and make it maintainable for a future programmer?

作者注:我没有看在年龄这个问题,最近有一个回应,让我感动我的回答到这个问题,并删除了答案(因为它WASN 吨真的答案)。

Author's Note: I hadn't looked at this question in ages, there was a recent response, so I moved my 'answer' into the question and deleted the 'answer' (since it wasn't really an answer).

推荐答案

根据我的经验与混合VB和C#项目,我会建议留在VB.NET一些大型应用程序的工作。如果有问题的设计,那么解决这些问题,但将整个事情到C#听起来像一个混乱的,不必要的分心给我。

Based on my experience working with some large applications that mix VB and C# projects, I would recommend leaving it in VB.NET. If there are problems with the design, then fix them, but converting the whole thing to C# sounds like a messy, unnecessary distraction to me.

这两种语言之间的非文体差异是非常小的,所以很难看到一个功能需要,将强制转换。 (有一个老的bug在Visual Studio 2003中排除了项目引用了混合的具体方式C#和VB项目的某些链,但是这是唯一一个我曾经遇到的一个实际障碍。)

The non-stylistic differences between the two languages are very minimal, so it is hard to see a functional need that would force a conversion. (There was an old bug in Visual Studio 2003 that ruled out certain chains of project references that mixed C# and VB projects in specific ways, but that is the only one I have ever run into as a practical obstacle.)

个别开发商当然倾向于有一个文体preference偏袒一方或另一方,而是一个完整的转换是有很多工作要做的东西,相当于为不同口味的语法糖的味道。

Individual developers certainly tend to have a stylistic preference favoring one or the other, but a full conversion is a lot of work to do for something that amounts to a taste for a different flavor of syntactic sugar.

这篇关于移植VB.NET WinForms应用程序到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆