在VB.NET VB运行时函数VB6的程序员 [英] VB runtime functions in VB.NET for VB6 programmers

查看:202
本文介绍了在VB.NET VB运行时函数VB6的程序员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是$ P $上的Visual Basic 2005 pparing一类针对Visual Basic 6的程序员迁移到.NET平台。

I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform.

我最关注的是教我的学生的最佳实践为.NET开发,和我想知道是否要考虑使用的VB运行时函数VB.NET合法与否。

My primary concern is to teach my students the best practices for developing in .NET, and I am wondering about whether to consider the use of the VB runtime functions VB.NET legitimate or not.

我看了很多的VB.NET的VB函数实际调用在.NET Framework方法,所以会出现它们的存在主要是为了缓解从早期基本到VB.NET版本的视觉过渡。然而, VB.NET的团队似乎推荐使用它们whenvever可能的,因为他们声称,他们把一些优化在那里在.NET框架的API之上。

I have read that many of the VB functions in VB.NET actually invoke methods on the .NET Framework, so it appears they exist primarily to ease the transition from earlier versions of Visual Basic to VB.NET. However, the VB.NET team seems to recommend to use them whenvever possible since they claim they put some optimizations in there on top of the .NET framework APIs.

请问你对此怎么看?

推荐答案

我在哪里,我要经常来回移动C#和VB.Net之间。考虑到这一点,我们真的不喜欢旧的VB的功能,特别是字符串的函数:修剪(),替换(),莱恩(),用Ucase(),等他们只是看起来很奇怪在.NET程序,我不希望看到他们在code我必须去努力。

Where I'm at, I have to move back and forth between C# and VB.Net frequently. With that in mind, we really don't like the old VB functions, especially the strings functions: Trim(), Replace(), Len(), UCase(), etc. They just look odd in a .Net program, and I wouldn't want to see them in code I had to work on.

唯一的例外可能会有莱恩(),如果你使用读code在你的头上 verbage。 theString 。在这种情况下,读莱恩(theString)的长度似乎是有道理的。在其他情况下,更重要的字符串进行操作的,所以我想看到的。 (点)符号。

The only exception there might be Len(), if you read code in your head using the of verbage. In that case, reading Len(theString) as length of theString seems to make sense. In the others, it's more of an operation performed by the string, and so I want to see the . (dot) notation.

在另一方面,我有一个很难从转换操作符断奶自己: CStr的,CINT,CDbl

On the other hand, I've had a hard time weaning myself from the conversion operators: CStr, CInt, CDbl, etc.

我不能告诉你为什么我喜欢一种类型,而不是其他;这可能仅仅是因为我发现Convert.To ___()太冗长,或者有事情做与他们是的运营商的,而不是功能。

I can't tell you why I like one type and not the other; it could just be that I find Convert.To___() too verbose, or maybe it has something to do with them being operators rather than functions.

修改
这一点有点迷失在帖子的休息,所以我想再次强调的是:

Edit
This point kinda got lost in the rest of my post, so I want to emphasize it again:

在很多地方,VB.Net共存于C#。我不认为你看到尽可能多的VB.Net只商店,您可以为C#。这只是不是受欢迎的,很多的VB.Net商店转移到VB.Net只是作为一个过渡状态,而程序员还学习C#。 在这些复杂环境中,这是使一个很大的意义,如果旧的VB函数严禁在新的code 的你永远不知道什么时候一个模块需要被移动过,并有一些在塌实股的开销,能够在一次神交两种风格。所以,这真是一个糟糕的主意不明白两者。

In a lot of places, VB.Net co-exists with C#. I don't think you see as many VB.Net-only shops as you might for C#. It's just not as popular, and a lot of the VB.Net shops move to VB.Net just as a transition state while the programmers also learn C#. In these mixed environments, it's makes a lot of sense if the old VB functions are strictly forbidden in new code. You never know when a module will need to be moved over, and there is some mind-share overhead in having to be able to grok both styles at once. So it's really a bad idea not to understand both.

这篇关于在VB.NET VB运行时函数VB6的程序员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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