C#比VB好吗? [英] C# is Better Than VB ?

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

问题描述

你好!!!

我听说C#比VB好,因为Microsoft .NET开发的优化和标准是什么?

解决方案




Daniyal写道:

你好!!!
我听说C#比VB更好,因为Microsoft .NET开发的优化和标准?




这取决于你的VB意思。它比VB6更好,原因是你已经列出了b $ b,但是VB.NET使用相同的框架和编译

例程,这使两者成为等价的。 Langauge的差异使得一些

构造在每个语言中更自然。任何使用CLR的其他语言都是如此。


看起来很奇怪,特别是因为我是一个很大的C#用户真的不能

基于道德理由支持VB; - )...在某些情况下,VB

编译器生成更整洁且明显更快的代码而不是确切的

相当于C#代码。


但是,我只是说这是为了表明我的公正性。


-

Bob Powell [MVP]

Visual C#,System.Drawing


Ramuseco Limited .NET咨询
http://www.ramuseco.com


查找Windows窗体提示和技巧中的精彩Windows窗体文章
http:// www。 bobpowell.net/tipstricks.htm


用GDI + FAQ回答那些GDI +问题
http://www.bobpowell.net/faqmain.htm


所有新文章都提供C#和VB.NET中的代码。

订阅所提供的RSS提要,绝不会错过任何新文章。


Daniyal <沓***** @ discussions.microsoft.com>在留言中写道

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

你好!!!
我听说C#优于VB,因为Microsoft .NET开发的优化和标准是什么?



Bob Powell [MVP]< bob@_spamkiller_bobpowell.net>写道:

看起来很奇怪,特别是因为我是一个很大的C#用户,真的不能在道德的基础上站在VB; - )......有些情况下VB
编译器生成的代码比准确的等效C#代码更快,代码更快。




有趣 - 你有什么例子吗?我已经看到了完全相反的情况,

其中VB.NET编译器生成的IL指令较少,但更大的是
,因此以字节为单位的方法大小是对于VB.NET而言,对于C#来说,这比

更大。在这种情况下,大小可能超过

内联/非内联边界并使C#代码更快。

的重要性当然是绝对微不足道的 - 但是我没有听说过反向情况的



-

Jon Skeet - < sk *** @ pobox.com>
http://www.pobox.com/~skeet 博客: http://www.msmvps.com/jon.skeet

如果回复小组,请不要给我发邮件


Hello!!!
I have heard that C# is better than VB because of optimization and standard
of Microsoft .NET development?

解决方案



"Daniyal" wrote:

Hello!!!
I have heard that C# is better than VB because of optimization and standard
of Microsoft .NET development?



That depends on which VB you mean. It''s better than VB6 for the reasons
you''ve listed, but VB.NET uses the identical framework and compilation
routines which makes the two equivilant. Langauge differences make some
constructs more natural to do in each langauge. The same is true of any
other language using the CLR.


Strange as it may seem, especially as I am a big C# user that really can''t
stand VB on moral grounds ;-)... There are some instances where the VB
compiler generates neater and demonstrably faster code than the exact
equivalent C# code.

However, I only say this as a demonstration of my impartiality.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Daniyal" <Da*****@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...

Hello!!!
I have heard that C# is better than VB because of optimization and
standard
of Microsoft .NET development?



Bob Powell [MVP] <bob@_spamkiller_bobpowell.net> wrote:

Strange as it may seem, especially as I am a big C# user that really can''t
stand VB on moral grounds ;-)... There are some instances where the VB
compiler generates neater and demonstrably faster code than the exact
equivalent C# code.



Interesting - do you have any examples? I''ve seen the exact reverse,
where the VB.NET compiler generates fewer IL instructions, but bigger
ones, such that the size of a method in bytes is bigger for VB.NET than
for C#. In cases like that, it''s possible for the size to go over the
inlined/not-inlined boundary and make the C# code faster. The chances
of that being significant are absolutely miniscule, of course - but I
hadn''t heard about the reverse situation.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


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

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