从经典的ASP到.net c#或vb?

时间:2021-08-17 05:15:21

I'm a hobbyist programmer with couple of database driven mobile web sites and I finally have decided to switch from classic asp to .net. But after couple of days reading I couldn’t decide which way I should go. Shall I learn c# or continue to vb in .net?

我是一个业余爱好者程序员,有几个数据库驱动的移动网站,我终于决定从经典的asp切换到.net。但经过几天的阅读,我无法决定应该走哪条路。我应该学习c#还是继续学习.net?

13 个解决方案

#1


10  

For hobbyist programming (i.e. a non-commercial endeavour you will only work on yourself), it really doesn't make any real difference.

对于业余爱好者编程(即非商业性的努力,你只会自己工作),它确实没有任何真正的区别。

Go with whichever you are more comfortable with.

选择你更舒服的人。

#2


6  

I faced this one about 3 years ago in my Job. If you look in depth at the syntax of the languages you will see they are very close.

我大约3年前在我的工作中遇到过这个。如果你仔细研究语言的语法,你会发现它们非常接近。

I went with the C# way as it seemed more widely used, asked for, more examples were available and it was cross platform (the mono vb.net was lacking last time I looked).

我使用C#方式,因为它看起来更广泛使用,要求,更多的例子可用,它是跨平台的(上一次我看的单声道vb.net缺乏)。

#3


6  

C# because if you know it, your job opportunities will be bigger and it's in my opinion a much more elegant language.

C#因为如果你知道的话,你的工作机会会更大,而且我认为这是一种更优雅的语言。

It has a bigger community and you will probably find more tutorials written in c#. If you choose either language, there are online converters available to help you.

它有一个更大的社区,您可能会发现更多用c#编写的教程。如果您选择其中一种语言,可以使用在线转换器来帮助您。

You will have an easy time reading Java code afterwards. You will also probably feel somewhat at home with c or c++ syntax.

之后您将轻松阅读Java代码。使用c或c ++语法时,您也可能会感到宾至如归。

Oh and if you've never been exposed to web forms and come from a classic asp background, why not give asp.net mvc a try? It's nearer to 'the old ways' in some regards.

哦,如果您从未接触过Web表单并且来自经典的asp背景,为什么不试试asp.net mvc呢?在某些方面,它更接近“旧方式”。

#4


3  

I found VB.Net really hard to pick up after working in VB since 1991 - the languages are similar enough to feel familiar but different enough to constantly trip me up. To make it even more confusing, I do a lot of work with Excel/VBA, which is still VB6.

我发现自从1991年开始使用VB之后,VB.Net真的难以接受 - 这些语言相似,足以让人感到熟悉,但又足以让我不断绊倒。为了让它更加混乱,我使用Excel / VBA做了很多工作,它仍然是VB6。

So I much prefer C# when I'm working in .Net: I was never much of a C++ or Java programmer, so I don't trip over differences there.

所以当我在.Net工作时,我更喜欢C#:我从来不是一个C ++或Java程序员,所以我不会在那里绊倒差异。

On the downside, C# being case-sensitive is tedious after years of VB auto-correction...

在缺点方面,经过多年的VB自动修正后,C#区分大小写很乏味......

#5


2  

c# for these reasons:

c#出于以下原因:

  1. I don't have any conclusive proof or anything, but it seems that c# programmers have an easier time reading/coding vb.net code than the other way around.
  2. 我没有任何确凿的证据或任何东西,但似乎c#程序员比其他方式更容易阅读/编码vb.net代码。

  3. c# seems to be more popular in the job market (I know you are a hobbyist, but still...)
  4. c#似乎在就业市场上更受欢迎(我知道你是一个业余爱好者,但仍然......)

  5. c# is syntactically closer to c/c++/java. If you ever want to go into those other language, c# will put you at a slight advantage (except for java, in which you'd have a pretty good advantage since the languages are very similar.... you'd just need to mostly learn a new framework.)
  6. c#在语法上更接近于c / c ++ / java。如果你想进入那些其他语言,c#会让你有一点点优势(除了java,你会有很好的优势,因为语言非常相似......你只需要主要是学习一个新的框架。)

#6


2  

Although VB.Net is viable, the trend is toward C#. Most of the articles written by the top tier of developers today are in C# and it may save you time to simply develop in C# as opposed to having to translate your "syntactic thought process" back to VB.

虽然VB.Net是可行的,但趋势是C#。今天*开发人员编写的大多数文章都是在C#中,它可以节省您简单地用C#开发的时间,而不必将您的“语法思维过程”转换回VB。

You will find C# more challenging from the perspective that the syntax is case sensitive, and you might find yourself relying on intellisense more than what you'd expect.

从语法区分大小写的角度来看,你会发现C#更具挑战性,你可能会发现自己比你期望的更依赖智能感知。

#7


2  

I also started in asp classic and found it much easier to pick up VB.NET than C#. Sure, most of the samples are in C# but if you understand C# syntax it isn't that hard to understand and apply. You should be able to read both fairly comfortably either way.

我也从asp经典开始,发现它比C#更容易拿起VB.NET。当然,大多数样本都在C#中,但如果您了解C#语法,那么理解和应用并不难。无论哪种方式,您都应该能够相当舒适地阅读。

I'm not coding(nor do I want to) large, complex web applications. I find that VB has lots of little things that help me concentrate on the logic rather than "silly" things like case sensitivity.

我不编码(我也不想)大型复杂的Web应用程序。我发现VB有许多小东西可以帮助我专注于逻辑而不是像案例敏感的“愚蠢”的东西。

I think it has a lot to do with how you think. I find it 100 times easier to read VB than C# but other people are different. That is why there isn't just one language that is best for everybody.

我认为这与你的思考方式有很大关系。我发现阅读VB比C#容易100倍,但其他人则不同。这就是为什么不只有一种语言最适合每个人。

#8


1  

c#: it will be harder in the beginning, but will pay in the future. my opinion...

c#:一开始会更难,但将来会付钱。我的看法...

#9


1  

My feeling is that C# has a brighter future than VB, and will give you a much richer experience in the long term. The C derived syntax is also in use by many other modern languages and will make them easier to learn too.

我的感觉是C#拥有比VB更光明的未来,并且从长远来看会给你更丰富的体验。 C派生语法也被许多其他现代语言使用,并且使它们也更容易学习。

#10


1  

You can start with C# directly. There are not many common things in VB.NET and VB, dispite the look and feel.

你可以直接从C#开始。 VB.NET和VB中没有太多常见的东西,外观和感觉。

If you start with VB.NET, you have to learn the framework anyway.

如果从VB.NET开始,那么无论如何都必须学习框架。

#11


1  

My suggestion to you is to go with C#. I was a VB programmer, but I always felt left out of the programming community. C# uses the terminology which industry widely uses, where as VB.NET uses its own terminology.

我给你的建议是使用C#。我是一名VB程序员,但我总是感到被排除在编程社区之外。 C#使用业界广泛使用的术语,其中VB.NET使用自己的术语。

#12


1  

Just to echo a couple of people in here:

只是为了回应这里的几个人:

  • "Classic" ASP and VB.net are different beasts completely. Some of the syntax is similar but it's a whole different language once you start to dig in.

    “经典”ASP和VB.net完全是不同的野兽。有些语法类似,但一旦你开始深入研究,它就是一种完全不同的语言。

  • You might get confused if you stick with a VB-like language. So much is different in ASP.NET that I would strongly consider starting afresh completely. Buying a C# book and making a weekend of it might be the best way to clean out the learning pipes.

    如果你坚持使用类似VB的语言,你可能会感到困惑。在ASP.NET中有很多不同之处我强烈考虑完全重新开始。购买C#书并制作周末可能是清理学习管道的最佳方法。

  • C# is much, much more anal about cases and syntax. VB.Net is too compared to VBS (ASP) so you want to make sure whichever you're going with, you have a good IDE to watch your back and keep you in line while you're learning.

    对于案例和语法,C#更多,更肛门。 VB.Net与VBS(ASP)相比也是如此,所以你要确保无论你选择哪一个,你都有一个很好的IDE来观察你的背,让你在学习的同时保持一致。

  • C# looks a lot more sophisticated on a CV/resume compared to Visual Basic to a layman hiring manager. One is sharp and cutting and hot. The other is Basic. There are generally a lot more jobs for the C#/Java syntax than VB's anyway.

    与Visual Basic中的外行招聘经理相比,C#在简历/简历上看起来要复杂得多。一个是锋利,切割和热。另一个是基础。无论如何,C#/ Java语法通常比VB更多。

  • But ultimately you should go where you're happiest. You have complete free choice so enjoy yourself.

    但最终你应该去你最开心的地方。你有完全*的选择,所以尽情享受。

#13


0  

The two languages are very similar, just what I call syntactic sugar differences. Choose what you are more happy with. I too would echo others in saying if you have do not feel strongly then you should go c# as this is more prolific language.

这两种语言非常相似,正如我所说的语法糖差异。选择你更满意的。我也会回应别人说如果你感觉不强烈那么你应该去c#,因为这是更多产的语言。

A couple of other hints while you are here.

当你在这里时还有其他一些提示。

  • No more hidden fields - you no longer have to have hidden fields holding your state, use either the Session collection or the ViewState collection.
  • 不再需要隐藏字段 - 您不再需要拥有保存状态的隐藏字段,使用Session集合或ViewState集合。

  • Move your database access out into a different project, don't talk to the db from the page or the page code behind.
  • 将数据库访问权限移到另一个项目中,不要从页面或后面的页面代码与数据库进行通信。

  • Look at using some ORM Object relation mapping (LLBGenPro, CodeSmith, LINK to SQL, etc)
  • 看看使用一些ORM对象关系映射(LLBGenPro,CodeSmith,LINK到SQL等)

  • Log all exceptions look at the application events in global.aspx.cs
  • 记录所有异常,查看global.aspx.cs中的应用程序事件

Welcome to a brand new world!

欢迎来到一个崭新的世界!

#1


10  

For hobbyist programming (i.e. a non-commercial endeavour you will only work on yourself), it really doesn't make any real difference.

对于业余爱好者编程(即非商业性的努力,你只会自己工作),它确实没有任何真正的区别。

Go with whichever you are more comfortable with.

选择你更舒服的人。

#2


6  

I faced this one about 3 years ago in my Job. If you look in depth at the syntax of the languages you will see they are very close.

我大约3年前在我的工作中遇到过这个。如果你仔细研究语言的语法,你会发现它们非常接近。

I went with the C# way as it seemed more widely used, asked for, more examples were available and it was cross platform (the mono vb.net was lacking last time I looked).

我使用C#方式,因为它看起来更广泛使用,要求,更多的例子可用,它是跨平台的(上一次我看的单声道vb.net缺乏)。

#3


6  

C# because if you know it, your job opportunities will be bigger and it's in my opinion a much more elegant language.

C#因为如果你知道的话,你的工作机会会更大,而且我认为这是一种更优雅的语言。

It has a bigger community and you will probably find more tutorials written in c#. If you choose either language, there are online converters available to help you.

它有一个更大的社区,您可能会发现更多用c#编写的教程。如果您选择其中一种语言,可以使用在线转换器来帮助您。

You will have an easy time reading Java code afterwards. You will also probably feel somewhat at home with c or c++ syntax.

之后您将轻松阅读Java代码。使用c或c ++语法时,您也可能会感到宾至如归。

Oh and if you've never been exposed to web forms and come from a classic asp background, why not give asp.net mvc a try? It's nearer to 'the old ways' in some regards.

哦,如果您从未接触过Web表单并且来自经典的asp背景,为什么不试试asp.net mvc呢?在某些方面,它更接近“旧方式”。

#4


3  

I found VB.Net really hard to pick up after working in VB since 1991 - the languages are similar enough to feel familiar but different enough to constantly trip me up. To make it even more confusing, I do a lot of work with Excel/VBA, which is still VB6.

我发现自从1991年开始使用VB之后,VB.Net真的难以接受 - 这些语言相似,足以让人感到熟悉,但又足以让我不断绊倒。为了让它更加混乱,我使用Excel / VBA做了很多工作,它仍然是VB6。

So I much prefer C# when I'm working in .Net: I was never much of a C++ or Java programmer, so I don't trip over differences there.

所以当我在.Net工作时,我更喜欢C#:我从来不是一个C ++或Java程序员,所以我不会在那里绊倒差异。

On the downside, C# being case-sensitive is tedious after years of VB auto-correction...

在缺点方面,经过多年的VB自动修正后,C#区分大小写很乏味......

#5


2  

c# for these reasons:

c#出于以下原因:

  1. I don't have any conclusive proof or anything, but it seems that c# programmers have an easier time reading/coding vb.net code than the other way around.
  2. 我没有任何确凿的证据或任何东西,但似乎c#程序员比其他方式更容易阅读/编码vb.net代码。

  3. c# seems to be more popular in the job market (I know you are a hobbyist, but still...)
  4. c#似乎在就业市场上更受欢迎(我知道你是一个业余爱好者,但仍然......)

  5. c# is syntactically closer to c/c++/java. If you ever want to go into those other language, c# will put you at a slight advantage (except for java, in which you'd have a pretty good advantage since the languages are very similar.... you'd just need to mostly learn a new framework.)
  6. c#在语法上更接近于c / c ++ / java。如果你想进入那些其他语言,c#会让你有一点点优势(除了java,你会有很好的优势,因为语言非常相似......你只需要主要是学习一个新的框架。)

#6


2  

Although VB.Net is viable, the trend is toward C#. Most of the articles written by the top tier of developers today are in C# and it may save you time to simply develop in C# as opposed to having to translate your "syntactic thought process" back to VB.

虽然VB.Net是可行的,但趋势是C#。今天*开发人员编写的大多数文章都是在C#中,它可以节省您简单地用C#开发的时间,而不必将您的“语法思维过程”转换回VB。

You will find C# more challenging from the perspective that the syntax is case sensitive, and you might find yourself relying on intellisense more than what you'd expect.

从语法区分大小写的角度来看,你会发现C#更具挑战性,你可能会发现自己比你期望的更依赖智能感知。

#7


2  

I also started in asp classic and found it much easier to pick up VB.NET than C#. Sure, most of the samples are in C# but if you understand C# syntax it isn't that hard to understand and apply. You should be able to read both fairly comfortably either way.

我也从asp经典开始,发现它比C#更容易拿起VB.NET。当然,大多数样本都在C#中,但如果您了解C#语法,那么理解和应用并不难。无论哪种方式,您都应该能够相当舒适地阅读。

I'm not coding(nor do I want to) large, complex web applications. I find that VB has lots of little things that help me concentrate on the logic rather than "silly" things like case sensitivity.

我不编码(我也不想)大型复杂的Web应用程序。我发现VB有许多小东西可以帮助我专注于逻辑而不是像案例敏感的“愚蠢”的东西。

I think it has a lot to do with how you think. I find it 100 times easier to read VB than C# but other people are different. That is why there isn't just one language that is best for everybody.

我认为这与你的思考方式有很大关系。我发现阅读VB比C#容易100倍,但其他人则不同。这就是为什么不只有一种语言最适合每个人。

#8


1  

c#: it will be harder in the beginning, but will pay in the future. my opinion...

c#:一开始会更难,但将来会付钱。我的看法...

#9


1  

My feeling is that C# has a brighter future than VB, and will give you a much richer experience in the long term. The C derived syntax is also in use by many other modern languages and will make them easier to learn too.

我的感觉是C#拥有比VB更光明的未来,并且从长远来看会给你更丰富的体验。 C派生语法也被许多其他现代语言使用,并且使它们也更容易学习。

#10


1  

You can start with C# directly. There are not many common things in VB.NET and VB, dispite the look and feel.

你可以直接从C#开始。 VB.NET和VB中没有太多常见的东西,外观和感觉。

If you start with VB.NET, you have to learn the framework anyway.

如果从VB.NET开始,那么无论如何都必须学习框架。

#11


1  

My suggestion to you is to go with C#. I was a VB programmer, but I always felt left out of the programming community. C# uses the terminology which industry widely uses, where as VB.NET uses its own terminology.

我给你的建议是使用C#。我是一名VB程序员,但我总是感到被排除在编程社区之外。 C#使用业界广泛使用的术语,其中VB.NET使用自己的术语。

#12


1  

Just to echo a couple of people in here:

只是为了回应这里的几个人:

  • "Classic" ASP and VB.net are different beasts completely. Some of the syntax is similar but it's a whole different language once you start to dig in.

    “经典”ASP和VB.net完全是不同的野兽。有些语法类似,但一旦你开始深入研究,它就是一种完全不同的语言。

  • You might get confused if you stick with a VB-like language. So much is different in ASP.NET that I would strongly consider starting afresh completely. Buying a C# book and making a weekend of it might be the best way to clean out the learning pipes.

    如果你坚持使用类似VB的语言,你可能会感到困惑。在ASP.NET中有很多不同之处我强烈考虑完全重新开始。购买C#书并制作周末可能是清理学习管道的最佳方法。

  • C# is much, much more anal about cases and syntax. VB.Net is too compared to VBS (ASP) so you want to make sure whichever you're going with, you have a good IDE to watch your back and keep you in line while you're learning.

    对于案例和语法,C#更多,更肛门。 VB.Net与VBS(ASP)相比也是如此,所以你要确保无论你选择哪一个,你都有一个很好的IDE来观察你的背,让你在学习的同时保持一致。

  • C# looks a lot more sophisticated on a CV/resume compared to Visual Basic to a layman hiring manager. One is sharp and cutting and hot. The other is Basic. There are generally a lot more jobs for the C#/Java syntax than VB's anyway.

    与Visual Basic中的外行招聘经理相比,C#在简历/简历上看起来要复杂得多。一个是锋利,切割和热。另一个是基础。无论如何,C#/ Java语法通常比VB更多。

  • But ultimately you should go where you're happiest. You have complete free choice so enjoy yourself.

    但最终你应该去你最开心的地方。你有完全*的选择,所以尽情享受。

#13


0  

The two languages are very similar, just what I call syntactic sugar differences. Choose what you are more happy with. I too would echo others in saying if you have do not feel strongly then you should go c# as this is more prolific language.

这两种语言非常相似,正如我所说的语法糖差异。选择你更满意的。我也会回应别人说如果你感觉不强烈那么你应该去c#,因为这是更多产的语言。

A couple of other hints while you are here.

当你在这里时还有其他一些提示。

  • No more hidden fields - you no longer have to have hidden fields holding your state, use either the Session collection or the ViewState collection.
  • 不再需要隐藏字段 - 您不再需要拥有保存状态的隐藏字段,使用Session集合或ViewState集合。

  • Move your database access out into a different project, don't talk to the db from the page or the page code behind.
  • 将数据库访问权限移到另一个项目中,不要从页面或后面的页面代码与数据库进行通信。

  • Look at using some ORM Object relation mapping (LLBGenPro, CodeSmith, LINK to SQL, etc)
  • 看看使用一些ORM对象关系映射(LLBGenPro,CodeSmith,LINK到SQL等)

  • Log all exceptions look at the application events in global.aspx.cs
  • 记录所有异常,查看global.aspx.cs中的应用程序事件

Welcome to a brand new world!

欢迎来到一个崭新的世界!