简体   繁体   English

移动到 ASP.NET - VB 还是 C#?

[英]Moving to ASP.NET - VB or C#?

We have a large ASP classic code base but I'm looking to do future development in ASP.NET (and potentially in the future port across what we have).我们有一个大型 ASP 经典代码库,但我希望在 ASP.NET 中进行未来的开发(并且可能在未来移植到我们所拥有的)。 The natural choice of language seems to be VB (existing code is VBScript) but am I being too hasty?语言的自然选择似乎是 VB(现有代码是 VBScript),但我是不是太草率了? Does the choice of language, in the long run, even make a difference?从长远来看,语言的选择甚至会产生影响吗?

It's learning.Net (framework) that takes the time.花时间的是learning.Net(框架)。

The specific language doesn't matter and is more a matter of taste.具体语言无关紧要,更多的是品味问题。 I'd normally recommend trying a few play projects in both languages (and any others that may take your fancy), and then decide which one you're more comfortable with (or have more success with!)我通常建议尝试使用两种语言(以及您可能喜欢的任何其他语言)的一些游戏项目,然后决定您更喜欢哪一种(或更成功!)

First of all, don't port something for the sake of it.首先,不要为了它而移植某些东西。 If it's working fine and there's little to be gained from porting it, leave it alone, and continue doing bugfixes and small enhancements in VBScript. If there's sufficient reason to move things across, then do it at that point, but you're much better off becoming familiar with the.Net version of web applications first rather than try and learn that on the fly if you do the port upfront.如果它工作正常并且移植它没有什么好处,那就别管它,并继续在 VBScript 中进行错误修复和小的增强。如果有足够的理由移动东西,那么就在那一点上做,但你会好得多如果您预先进行端口操作,请先熟悉 web 应用程序的 .Net 版本,而不是尝试即时学习。 It's much easier to learn the new concepts like PostBack and ViewState in a 'clean' environment.在“干净”的环境中学习 PostBack 和 ViewState 等新概念要容易得多。

There's also less scope to break out of your old way of thinking as you port stuff (just making it work any old how rather than redesigning where needed).也有更少的 scope 可以打破你在移植东西时的旧思维方式(只是让它按照旧的方式工作,而不是在需要的地方重新设计)。

Ultimately there's not a great deal of difference in the long run, it's mostly perceptual and a matter of personal taste but I'd propose learning C# first because it's lack of familiarity will emphasise the fact that you're learning something new.从长远来看,最终并没有太大的区别,这主要是感性的和个人品味的问题,但我建议先学习 C#,因为不熟悉会强调你正在学习新东西的事实。 Hopefully thi will help you learn to do things the natural.Net way rather than the largely procedural VB(script) way.希望这会帮助您学习以自然的 .Net 方式做事,而不是主要是程序化的 VB(脚本)方式。 You're trying to unlearn as well as learn.你在学习的同时也在努力忘却。 Familiarity of some keywords will work against you.熟悉某些关键字会对您不利。

Echoing other benefits throughout some of the posts, and adding a few of my own:在一些帖子中呼应其他好处,并添加一些我自己的好处:

  • Future potential earnings: C# developers generally are worth more than VB.Net developers because of the perceptual difference.未来潜在收益:C# 由于认知差异,开发人员的身价普遍高于VB.Net 开发人员。
  • Most of the open source.Net code out there is C#, and the quality of it generally (though not always) tends to be higher.大多数开源 .Net 代码都是 C#,而且它的质量通常(尽管不总是)往往更高。
  • There are more Q&A and examples and out there on the inte.net in C# than VB.Net. inte.net C# 上的问答和示例比 VB.Net 多。 At the time I post this there's 1572 posts tagged with C#, only 185 with VB.Net right here on Stack OverFlow.在我发布这篇文章时,Stack OverFlow 上有1572个标记为 C# 的帖子,只有185个标记为 VB.Net。
  • C# OO keywords are reasonably standard, it makes it easier to read other OO language code. C# OO 关键字相当标准,它更容易阅读其他 OO 语言代码。 VB.Net goes off and renames things for no good reason eg abstract (C#, C++, Java and more...) vs MustInherit (VB.Net only). VB.Net 关闭并无缘无故地重命名事物,例如抽象(C#、C++、Java 等...)与MustInherit (仅限 VB.Net)。
  • It's generally accepted that once your familiar in both languages it's a lot easier to visually parse C# code than VB.Net code人们普遍认为,一旦您熟悉这两种语言,与 VB.Net 代码相比,直观地解析 C# 代码要容易得多
  • You won't get 'looked down' on by C#'ers and can help poke fun at the VB.Net people (if you so desire - the culture exists...)你不会被 C# 的人“看不起”,并且可以帮助取笑 VB.Net 的人(如果你愿意 - 这种文化存在......)

Once you've initially learned it in C#, it should be much easier to roll across to VB.Net than it would be the other way around.一旦您在 C# 中初步了解了它,那么转向 VB.Net 应该比反过来要容易得多。 Invest in your own future.投资于你自己的未来。

When I moved from ASP3 to ASP.NET I finally choosed to use C# instead of VB.NET.当我从 ASP3 迁移到 ASP.NET 时,我最终选择使用 C# 而不是 VB.NET。

I wrote Basics for years (MS-BAsic, GW-Basic, Quick-Basic, Visual Basic, VBScript) and it was very difficult to use VB.NET because I always try to write things as I used to do with VB6 or VBScript.我写了很多年的基础知识(MS-BAsic、GW-Basic、Quick-Basic、Visual Basic、VBScript),使用 VB.NET 非常困难,因为我总是尝试像以前使用 VB6 或 VBScript 那样写东西。

So C# was a better choice for me: I have not been slowed by the weight of my habits.所以 C# 对我来说是一个更好的选择:我的习惯并没有拖慢我的速度。

Also, C# was a new language (at this time) while new VB.NET keywords gave him a Cobol smell:)此外,C# 是一种新语言(此时),而新的 VB.NET 关键字给了他 Cobol 的味道:)

Also, don't forget that you can mix and match within a project!另外,不要忘记您可以在一个项目中混合搭配!

I would choose the language with the syntax you are most comfortable with as there is very little difference in functionality, although some say there is something of a culture difference between VB and c# developers.我会选择具有您最熟悉的语法的语言,因为它们在功能上几乎没有区别,尽管有人说 VB 和 c# 开发人员之间存在文化差异。 Another option is to learn both, the biggest obstacle moving to .net in my opinion is learning the huge .net framework, the actual language syntax you should be able to pick up fairly quickly.另一种选择是两者都学习,我认为迁移到 .net 的最大障碍是学习庞大的 .net 框架,您应该能够相当快地掌握实际的语言语法。

The important thing is to learn .NET. not a particular language because C# or VB changes just syntax.重要的是学习 .NET。不是特定的语言,因为 C# 或 VB 只改变语法。 The logic behind them in .NET environment is same.在 .NET 环境中它们背后的逻辑是相同的。

You can do the same things in both C# or VB.NET. In the end it'd be a choice of which is easier to port to.您可以在 C# 或 VB.NET 中执行相同的操作。最终将选择哪个更容易移植。

Keeping in mind that you shouldn't (IMHO) port directly ASP to ASP.NET, since you'd loose much of the features in .NET, this would include a fair amount of rewrite anyway.请记住,您不应该(恕我直言)将 ASP 直接移植到 ASP.NET,因为您会失去 .NET 中的大部分功能,无论如何这将包括相当多的重写。 So I'd go with C# since I think it's less verbose and easier to write and read.所以我会用 go 和 C# 因为我认为它不那么冗长并且更容易编写和阅读。

.NET is really about the framework and the base class library. .NET 实际上是关于框架和基础 class 库的。 VB or C# - as Chris mentioned there is really just syntactical difference. VB 或 C# - 正如克里斯提到的那样,实际上只是语法上的差异。

Since you've done VBScript migration to VB.NET is more natural - you can learn the new syntax, then move onto the Framework and BCL, when you are familiar with those you can learn the C# syntax as weel - being bi-lingual is always good.因为你已经完成了 VBScript 迁移到 VB.NET 更自然 - 你可以学习新的语法,然后移动到框架和 BCL,当你熟悉那些你可以学习 C# 语法时,双语总是好的.

2sontek: There are also features in VB that aren't supported in C# - let's not go there. 2sontek:VB 中还有一些功能在 C# 中不受支持 - 让我们不要在那里使用 go。 80% (or more) of developers use only 20% of the features and the differences are very minor - they certainly don't fit into the 20% 80%(或更多)的开发人员只使用 20% 的功能,差异非常小——他们肯定不适合这 20%

I develop in both but C# would be my preferance.我在这两个方面都进行了开发,但我更喜欢 C#。

You can do the majority of things in both languages and I certianly wouldnt re write any vb projects in c#.你可以用两种语言做大部分事情,我当然不会在 c# 中重新编写任何 vb 项目。

However with C#: New language features generally come to c# first of all eg lamda expressions in linq You can write code in c# C# will force you to be neater C# developers get paid on average more and most larger projects will only be c# C# has similar syntax and function names to javascript There is some snobbery in the .net community towards vb developers However with C#: New language features generally come to c# first of all eg lamda expressions in linq You can write code in c# C# will force you to be neater C# developers get paid on average more and most larger projects will only be c# C# has similar语法和 function 名称为 javascript .net 社区对 vb 开发人员有些势利

Not much of a difference, but there is some difference (mostly syntactical in nature).区别不大,但有一些区别(本质上主要是语法上的)。 If your old site is VBScript, it's probably easier to go with VB.NET.如果您的旧站点是 VBScript,则 go 和 VB.NET 可能更容易。

There are a few features in C# 3.5 that aren't supported in Visual Basic but language choice is always preference from the team and what you guys feel most productive in. C# 3.5 中有一些功能在 Visual Basic 中不受支持,但语言选择始终是团队的偏好,也是你们觉得最有效率的地方。

From experience it is easiest to go with where your skillset currently lies.根据经验,最简单的方法是 go 与您当前的技能组合。 If this is in vb6/vbscript etc I would first look towards vb.net. It also depends on any project timescales and delivery dates.如果这是在 vb6/vbscript 等中,我会首先查看 vb.net。它还取决于任何项目时间表和交付日期。 You will be upto speed quicker in vb.net. If you have time on your hands I would seriously consider c#, if only to give you a stronger foothold in the development market when you come to look for pastures new. vb.net你会更快上手。如果你有时间我会认真考虑c#,如果只是为了让你在寻找新牧场时在开发市场上有更强的立足点。

You may also wan to look into C#.您可能还想查看 C#。

VB.Net and C# are both great for creating web applications, it really depends on the needs you will have. VB.Net 和 C# 都非常适合创建 web 应用程序,这实际上取决于您的需求。

For example C# is great with events and VB.Net is great with XML.例如 C# 非常适合事件,VB.Net 非常适合 XML。

I'd say go with what ever your developers feel more comfortable.我会说 go,你的开发人员觉得更舒服。

I was looking at a site recently that lists average UK wages based on technologies.我最近在看一个网站,该网站列出了基于技术的英国平均工资。 Can't find the link now (typical.) but I remember that the average C# wage was around £5k higher than the average VB.NET wage.现在找不到链接(典型),但我记得 C# 的平均工资比 VB.NET 的平均工资高 5000 英镑左右。

If you're not going to learn both (and there's really no reason not to, as the only real difference between them is syntax) I'd go for C#.如果你不打算同时学习这两者(而且真的没有理由不学习,因为它们之间唯一真正的区别是语法)我会选择 go 换成 C#。

.net or c# it ups to you on how you will solve the problem and what make you more creative. .net 或 c# 取决于您将如何解决问题以及如何让您更有创意。 But i think sooner the .net will be erased and c# will be the only language that can be used in asp.但我认为很快 .net 将被删除,c# 将成为唯一可以在 asp 中使用的语言。 i start learning the .net concept then after i change my language to c# for asp.net mvc so i suggest you must go to c# because it will help you more in future.我开始学习 .net 概念,然后在我将语言更改为 c# 以获取 asp.net mvc,所以我建议您必须将 go 更改为 c#,因为它将来对您有更多帮助。

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

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