gpt4 book ai didi

vb.net - 与 VB.NET 相比,为什么缺乏对 C# 的 IntelliSense 支持?

转载 作者:行者123 更新时间:2023-12-04 13:30:05 26 4
gpt4 key购买 nike

就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the help center寻求指导。




10年前关闭。




对我来说,为 Java 生态系统开发支付了很多年的账单。然而,几年来,我主要在.Net 领域工作。最初,我向 .Net 世界的过渡包括编写和维护 VB.Net 代码。 VS 提供了我在使用 Eclipse/Java 组合多年后所期望的几乎所有出色的智能感知支持。最终,我的雇主决定用 C# 进行新的开发。我对 C# 的智能感知支持的最初印象并不出色。有时 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 Luca Bolognese 一起,他强调了这些语言将不再偏离不同的方向,并将开始分享它们的相似之处。所以看起来 future 拥有美好的事物!

关于vb.net - 与 VB.NET 相比,为什么缺乏对 C# 的 IntelliSense 支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1081471/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com