加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

与VB.NET相比,为什么IntelliSense不支持C#?

发布时间:2020-12-17 00:25:49 所属栏目:大数据 来源:网络整理
导读:对我来说,Java生态系统的开发支付了多年的账单.但是,几年来,我一直主要在.Net领域工作.最初,我转换到.Net世界包括编写和维护VB.Net代码.在提供了多年的 Eclipse / Java组合工作之后,VS提供了我所期望的几乎所有优秀的intellisense支持.最终我的雇主决定用C#
对我来说,Java生态系统的开发支付了多年的账单.但是,几年来,我一直主要在.Net领域工作.最初,我转换到.Net世界包括编写和维护VB.Net代码.在提供了多年的 Eclipse / Java组合工作之后,VS提供了我所期望的几乎所有优秀的intellisense支持.最终我的雇主决定用C#做新的开发.我对c#的intellisense支持的最初印象不是很好.有时似乎VS没有C#的后台编译器,但偶尔它会做一些聪明的事情,表明那里有一些后台处理,但还不足以真正以有意义的方式提高生产力.关于两种语言之间智能感知支持的差异,是否有任何明智的技术原因?
现在,C#和VB之间存在差距. VB为您生成了很多代码.例如,在完成“If”语句后按Enter键将自动在该行的末尾添加“Then”(如果您将其关闭),并使用“End If”部分将其关闭.在C#中,您可以添加那些开始和结束{}花括号.

VB在C#之前很久就进行了后台编译.事实上,这是使用ReSharper的主要吸引力因素之一,它提供了这样的功能.但是,从VS 2008 / .NET 3.5 SP1开始,这一切都发生了变化.你可以阅读Scott Gu关于here的帖子,但我会粘贴相关部分:

“The C# code editor now identifies and
displays red squiggle errors for many
semantic code issues that previously
required an explicit compilation to
identify. For example,if you try to
declare and use an unknown type in the
C# code-editor today you won’t see a
compile error until you do a build.
Now with SP1 you’ll see live red
squiggle errors immediately (no
explicit compile required).”

使用CodeRush或ReSharper肯定会增强常见语句自动完成的体验,这将使VB开发人员感觉无缝过渡.

这并没有完全解决技术问题,但开发团队是不同的,并不一定做同样的事情.换句话说,不太可能采用共享方法. This blog post摘录,由VB团队的技术主管,支持:

“Background compilation” is the
feature in VB that gives you a
complete set of errors as you type.
People who move back and forth between
VB and C# notice this,but VB-only
developers may not realize that other
languages such as C# don’t always give
you 100% accurate Intellisense and
don’t always give you all of the
errors that exist in your code. This
is because their Intellisense engines
are separate,scaled-down compilers
that don’t do full compilation in the
background. VB,on the other hand,
compiles your entire project from
start to finish as Visual Studio sits
idle,allowing us to immediately
populate the task list with completely
accurate errors and allowing us to
give you completely accurate
Intellisense.

最后一个注意事项是recent Channel9 interview与C#/ VB / F#团队的PM PM,Luca Bolognese,他强调语言不再偏向不同的方向,并将开始分享他们的相似之处.所以看起来未来会有很棒的东西!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读