C#还是VB.NET? [英] C# or VB.NET?

查看:66
本文介绍了C#还是VB.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是.NET的初学者。我之前一直使用普通的asp进行编码,使用

VBScript,现在当我迁移到.NET时,我显然选择了VB.NET。


但是....当我在网上看到代码示例时,它们大部分都在C#中,我在这个新闻组中看到了一个

的帖子,有人提到它是一个非常加热的/ >
回顾2002年的主题关于VB.NET与C#" ;.


所以,我的问题是......那个话题的结果是什么?

什么是最好的,VB.NET或C#?为什么?


感谢和问候

解决方案

您选择的语言取决于因素数量。如果你是一名职业并且有职业生涯,那么C#将为你提供更好的赔率。

推进你的职业生涯。另外,正如您已经注意到的那样,查找用C#编写的示例和示例要容易得多。另一方面,如果您是一名临时或兼职开发人员,并且您很少或没有使用

C或Java语言系列的经验,并且熟悉使用VB或VBScript,并且你对b / b
不熟悉面向对象的编程,使用VB.Net可以更轻松地将它放到ASP.Net中,并且担心学习与否

学习C#以后。 ASP / /
classic和ASP.Net的编程范式之间的区别是一个相当学习的曲线。但是,当你开始学习ASP.Net时学习C#可能有助于你避免

陷入思考ASP经典术语的陷阱.Net。


最终,这完全取决于你,而且,正如Led Zeppelin曾经说过的那样,那里

是2条路径你可以过去,但从长远来看,还有时间改变你所在的道路。


-

HTH,


Kevin Spencer

鸡肉沙拉外科医生

Microsoft MVP


M。 Ali Qureshi < m。*********** @ hotmail.comwrote in message

news:72 ****************** **************** @ microsof t.com ...





我是.NET的初学者。我之前一直使用普通的asp进行编码,使用

VBScript,现在当我迁移到.NET时,我显然选择了VB.NET。


但是....当我在网上看到代码示例时,他们大部分都是在C#中,我也看到了这个新闻组中有人提到这是一个非常好的b $ ba
a b2002年关于VB.NET与C#的热门话题。


所以,我的问题是......那个话题的结果是什么?

什么是最好的,VB.NET或C#?为什么?


感谢和问候



" M. Ali Qureshi < m。*********** @ hotmail.comwrote in message

news:72 ****************** **************** @ microsof t.com ...


我是.NET的初学者。我之前使用普通ASP进行编码,使用

VBScript,现在当我迁移到.NET时,我显然选择了VB.NET。



显然???你已经清楚地陷入了VB.NET以某种方式升级Visual Basic并且ASP.NET在某种程度上是ASP升级的陷阱

Classic。除了一些外围的句法相似之外,没有什么比事实更进一步。原因当然是.NET Framework ...


既然你熟悉ASP Classic,你无疑会享受到舒适感

昏暗的因素这就是那样,如果...然后......否则...结束如果等...但是,因为

你熟悉ASP Classic,你差不多肯定有一些曝光

到JavaScript,所以基本的C#语法已经完全可以理解了

你...


但....当我在网上看到代码示例时,他们大多数都在C#中,我也看到了这个新闻组中有人提到它是一个非常好的

2002年关于VB.NET与C#的热门话题。



那是我......


所以,我的问题是......结果是什么那个话题?



没有结果,因为没有正确或错误的答案......两个

语言(几乎)相同功能 - C#对VB.NET的唯一主要优势是支持不安全的代码即指针。

两种语言(几乎)相同的原因是因为它们

针对.NET Framework。在最简单的层面上,它实际上并不是你所使用的.NET语言 - 它们都是相同的......


什么是最好的,VB.NET或C#?为什么?



两者,然后决定你喜欢哪个。


我个人认为VB.NET是一个完全不必要的语言,并且它纯粹出于营销原因而存在。早在2002年初,在微软和一个微小的beta测试社区之外,没有C#程序员在

全部。但是有数以百万计的VB程序员,并且微软

并不是要通过发布一个没有

基本风味的新开发套件来疏远它们......


在.NET之前,我几乎完全靠着基本的各种

方言生活,直到QuickBasic和通过VB对于DOS,

VB用于Windows,VBScript,AccessBasic,WordBasic,VBA等。


但是,在用C#约一天后,我知道我从来没有想再写一下另一张

系列的Basic!而且,除了2004年的一件作品,我只是简单地说b $ b不能拒绝,我从来没有......


但是,那个'只是我的意见......

-

Mark Rae

ASP.NET MVP
http://www.markrae.net


< blockquote>我不同意你的意见。虽然我喜欢C#,但这只是因为它带来了你可能会感觉到你的感觉(因为

模糊的感觉)当你认为它以某种方式与某些

方式的C ++相关时会得到 - 当它真的不是这样的时候。除了C#的指针和基本的

非托管代码能力(在大多数业务解决方案中无用),VB比C#做得更多

。 VB事件接线更好(故障),intellisense +语法

检查要好得多(在键入时进行后台编译),内置

函数包含大量代码(例如,Asc,Left,Mid等...

,可以优雅地处理异常)在VisualBasic库命名空间中,

和方便的我的命令。命名空间。再加上VB2008的高级LINQ / XML

实现,你有一个明显的优势。


现在,非常欢迎你更喜欢C#语法。但就

功能而言,VB并不是相同的。到C#......它更好。


C. Moya
http://www.cmoya.com


Mark Rae [MVP]" < ma ** @ markNOSPAMrae.netwrote in message

news:%2 **************** @ TK2MSFTNGP03.phx.gbl ...


" M. Ali Qureshi < m。*********** @ hotmail.comwrote in message

news:72 ****************** **************** @ microsof t.com ...


>我是.NET的初学者。我以前用普通的ASP编写代码,使用VBScript,现在当我迁移到.NET时,我显然选择了VB.NET。



显然???你已经清楚地陷入了VB.NET以某种方式升级Visual Basic并且ASP.NET在某种程度上是ASP升级的陷阱

Classic。除了一些外围的句法相似之外,没有什么能比实际更进一步。原因当然是.NET Framework ...


既然你熟悉ASP Classic,你无疑会享受到舒适感

昏暗的因素这就是那样,如果...然后......否则...结束如果等...但是,因为

你熟悉ASP Classic,你差不多肯定有一些

暴露在JavaScript中,所以基本的C#语法已经完全可以理解为你了...


>但....当我在网上看到代码示例时,他们大部分都是在C#中,我也看到了这个新闻组中的一个帖子,有人提到它是一个非常非常的帖子。 2002年关于VB.NET与C#的热门话题。



那是我......


>所以,我的问题是......什么是那个话题的结果?



没有结果,因为没有正确或错误的答案......两个

语言(几乎)相同功能 - C#在VB.NET上唯一的主要优势是支持不安全的代码,即
指针。两种语言(几乎)相同的原因是因为它们都是.NET Framework的目标。在最简单的层面上,它根本不重要你用的是什么.NET语言 - 它们都是

相同......
< blockquote class =post_quotes>
>什么是最好的,VB.NET或C#?为什么?



两者,然后决定你喜欢哪个。


我个人认为VB.NET是一个完全不必要的语言,

,纯粹出于营销原因而存在。早在2002年初,在微软和一个微小的beta测试社区之外,没有C#程序员

。但是有数以百万计的VB程序员,并且微软并不打算通过发布一个没有基本风格的新开发套件来疏远它们。


在.NET之前,我几乎完全靠着基本的各种

方言生活,直到QuickBasic和通过VB for

DOS,VB for Windows,VBScript,AccessBasic,WordBasic,VBA等。


但是,在用C#约一天后,我知道我从来没有想再写一下另一行Basic的

!而且,除了2004年的一件作品

,我根本无法拒绝,我从来没有...


但是,那个'只是我的意见......


-

Mark Rae

ASP.NET MVP
http://www.markrae.net


Hi,

I am a beginner in .NET. I have been coding in plain asp before, using
VBScript, and now when i''m migrating to .NET, i obviously chosed VB.NET.

But.... when i see code samples on net, they are mostly in C#, i also saw a
post in this newsgroup where someone mentioned that it was a very "heated
topic back in 2002 about VB.NET vs C#".

So, my question is... what was the result of that topic?
What is best to go for, VB.NET or C#? and why?

Thanks and regards

解决方案

Which language you choose depends on a number of factors. If you are a
professional and have career in mind, C# is going to give you better odds at
advancing your career. In addition, as you''ve noticed, it is much easier to
find examples and samples written in C#. On the other hand, if you are a
casual or part-time developer, and you have little or no experience with the
C or Java language families, and are familiar with VB or VBScript, and you
are not familiar with object-oriented programming, it might be easier for
you to ease into ASP.Net with VB.Net, and worry about learning or not
learning C# later on. The difference between the programming paradigm of ASP
classic and ASP.Net is quite a learning curve. However, it might be argued
that learning C# when you start learning ASP.Net will help you keep from
falling into the trap of thinking in ASP classic terms when doing ASP.Net.

Ultimately, it''s entirely up to you, and, as Led Zeppelin once said, "there
are 2 paths you can go by, but in the long run, there''s still time to change
the road you''re on."

--
HTH,

Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP

"M. Ali Qureshi" <m.***********@hotmail.comwrote in message
news:72**********************************@microsof t.com...

Hi,

I am a beginner in .NET. I have been coding in plain asp before, using
VBScript, and now when i''m migrating to .NET, i obviously chosed VB.NET.

But.... when i see code samples on net, they are mostly in C#, i also saw
a post in this newsgroup where someone mentioned that it was a very
"heated topic back in 2002 about VB.NET vs C#".

So, my question is... what was the result of that topic?
What is best to go for, VB.NET or C#? and why?

Thanks and regards



"M. Ali Qureshi" <m.***********@hotmail.comwrote in message
news:72**********************************@microsof t.com...

I am a beginner in .NET. I have been coding in plain ASP before, using
VBScript, and now when I''m migrating to .NET, I obviously chose VB.NET.

Obviously??? You''ve clearly fallen into the trap that VB.NET is somehow an
upgrade of Visual Basic and that ASP.NET is somehow an upgrade of ASP
Classic. Apart from some peripheral syntactic similarities, nothing could be
further from the truth. The reason, of course, is the .NET Framework...

Since you''re familiar with ASP Classic, you no doubt enjoy the comfort
factor of Dim This As That, If...Then...Else...End If etc... But, since
you''re familiar with ASP Classic, you''ve almost certainly had some exposure
to JavaScript, so basic C# syntax will already be totally understandable to
you...

But.... when i see code samples on net, they are mostly in C#, i also saw
a post in this newsgroup where someone mentioned that it was a very
"heated topic back in 2002 about VB.NET vs C#".

That was me...

So, my question is... what was the result of that topic?

There was no result, because there is no right or wrong answer... Both
languages are (almost) identical in terms of functionality - the only main
advantage that C# had over VB.NET was support for unsafe code i.e. pointers.
The reason that both languages are (almost) identical is because they both
target the .NET Framework. At it most simplistic level, it really doesn''t
matter at all what .NET language you use - they are all identical...

What is best to go for, VB.NET or C#? and why?

Both, and then decide which you prefer.

It''s my personal opinion that VB.NET is a totally unnecessary language, and
it exists purely for reasons of marketing. Back in early 2002, outside of
Microsoft and a tiny beta test community, there were no C# programmers at
all. But there were millions and millions of VB programmers, and Microsoft
weren''t about to alienate them by releasing a new development suite with no
flavour of Basic...

Prior to .NET, I''d made my living almost exclusively with the various
dialects of Basic right back as far as QuickBasic and on through VB for DOS,
VB for Windows, VBScript, AccessBasic, WordBasic, VBA etc.

But, after about a day with C#, I knew that I never wanted to write another
line of Basic again! And, apart from one piece of work in 2004 that I simply
couldn''t turn down, I never have...

However, that''s just my opinion...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


I disagree with you. Although I like C#, it''s only because of a sense of
cachet that it gives you that you probably feel the way you do (because of
the fuzzy feeling you get when you think it''s somehow related to C++ in some
way-- when really it''s not). Aside from C#''s pointer and rudimentary
unmanaged code ability (useless in most business solutions), VB does MORE
than C#. VB event wiring is better (withevents), intellisense + syntax
checking much much better (background compiling as you type), built in
functions that wrap a lot of code up (for example, Asc, Left, Mid etc...
that handle exceptions gracefully) in both the VisualBasic Library namespace
and the handy "My" namespace. Add to that VB2008''s superior LINQ/XML
implementation and you have a clear superior.

Now, you''re perfectly welcome to prefer the C# syntax. But in terms of
functionality VB is not "identical" to C#... it''s better.

C. Moya
http://www.cmoya.com

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...

"M. Ali Qureshi" <m.***********@hotmail.comwrote in message
news:72**********************************@microsof t.com...

>I am a beginner in .NET. I have been coding in plain ASP before, using
VBScript, and now when I''m migrating to .NET, I obviously chose VB.NET.


Obviously??? You''ve clearly fallen into the trap that VB.NET is somehow an
upgrade of Visual Basic and that ASP.NET is somehow an upgrade of ASP
Classic. Apart from some peripheral syntactic similarities, nothing could
be further from the truth. The reason, of course, is the .NET Framework...

Since you''re familiar with ASP Classic, you no doubt enjoy the comfort
factor of Dim This As That, If...Then...Else...End If etc... But, since
you''re familiar with ASP Classic, you''ve almost certainly had some
exposure to JavaScript, so basic C# syntax will already be totally
understandable to you...

>But.... when i see code samples on net, they are mostly in C#, i also saw
a post in this newsgroup where someone mentioned that it was a very
"heated topic back in 2002 about VB.NET vs C#".


That was me...

>So, my question is... what was the result of that topic?


There was no result, because there is no right or wrong answer... Both
languages are (almost) identical in terms of functionality - the only main
advantage that C# had over VB.NET was support for unsafe code i.e.
pointers. The reason that both languages are (almost) identical is because
they both target the .NET Framework. At it most simplistic level, it
really doesn''t matter at all what .NET language you use - they are all
identical...

>What is best to go for, VB.NET or C#? and why?


Both, and then decide which you prefer.

It''s my personal opinion that VB.NET is a totally unnecessary language,
and it exists purely for reasons of marketing. Back in early 2002, outside
of Microsoft and a tiny beta test community, there were no C# programmers
at all. But there were millions and millions of VB programmers, and
Microsoft weren''t about to alienate them by releasing a new development
suite with no flavour of Basic...

Prior to .NET, I''d made my living almost exclusively with the various
dialects of Basic right back as far as QuickBasic and on through VB for
DOS, VB for Windows, VBScript, AccessBasic, WordBasic, VBA etc.

But, after about a day with C#, I knew that I never wanted to write
another line of Basic again! And, apart from one piece of work in 2004
that I simply couldn''t turn down, I never have...

However, that''s just my opinion...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


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

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