当前位置: 首页 > 工具软件 > Visual Ruby > 使用案例 >

Visual Basic 6,Ruby和下车草坪

韩彦君
2023-12-01

David Platt has a great article called The Silent Majority: Why Visual Basic 6 Still Thrives. Even though I studied C++ in school, my first corporate job was in Visual Basic 2, then quickly VB3. By the time VB6 came out it's fair to say I could make that thing sing. It's funny how the older and more successful a language is, the more likely the language literati are to bash it. Bigger targets are, well, bigger.

大卫·普拉特(David Platt)有一篇很棒的文章,叫做《沉默的多数:为什么Visual Basic 6仍然会兴旺发展》 。 即使我在学校学习C ++,我的第一份公司工作是在Visual Basic 2中,然后是VB3。 到VB6发行时,可以说我可以唱歌了。 有趣的是,一种语言越古老,越成功,它就越有可能被文人贬低。 更大的目标也更大。

Visual Basic 6 first shipped in 1998, so its apps will have at least 24 years of supported lifetime. Contrast that with the Microsoft .NET Framework 1.0 (2002), which is incompatible with Windows 7 (2009). - David Platt

Visual Basic 6于1998年首次发布,因此其应用程序将具有至少24年的支持寿命。 与与Windows 7(2009)不兼容的Microsoft .NET Framework 1.0(2002)形成对比。 -大卫·普拉特( David Platt)

You could get SO much work done SO quickly in Visual Basic 6 and that itself made the experience of coding in it fun. Once you added in some of the advanced techniques with tools like Dan Appleman's SpyWorks and other comparatively low-level API tools, it was arguably near as powerful and productive as its more advanced brother, MFC and C++.

您可以在Visual Basic 6中快速完成大量工作,这本身就使在其中进行编码的体验变得有趣。 一旦使用Dan Appleman的SpyWorks之类的工具以及其他相对较低级别的API工具添加了一些先进的技术,就可以说它与更先进的MFC和C ++一样强大和高效。

Another key to the success of Visual Basic 6 was the much shorter learning curve demanded by its limited feature set. Learning to drive a bus takes much less time than learning to fly a fighter jet. Becoming a good Visual Basic 6 programmer took much less time than becoming a good C++ programmer, the primary alternative at the time. - David Platt

Visual Basic 6成功的另一个关键是其有限功能集要求的学习曲线短得多。 学习驾驶公共汽车比学习驾驶战斗机花费的时间少得多。 成为一名优秀的Visual Basic 6程序员比成为一名优秀的C ++程序员(当时的主要选择)花费的时间少得多。 -大卫·普拉特( David Platt)

A Hacker News discussion started up around this article and one HN'er said what I've been saying for years (emphasis mine):

围绕此文章展开了一次Hacker News讨论,一位HN'er说了我多年来一直在说的话(重点是我的话):

For those who have never used it, VB6 syntax is actually very similar to Ruby. It uses English language words instead of braces, does not require parentheses, and uses dynamic typing.

对于从未使用过它的人,VB6语法实际上与Ruby非常相似。 它使用英语单词代替大括号,不需要括号,并使用动态类型。

VB6 is also quite fast, all things considered, and runs on lots of fairly old hardware.

考虑到所有因素,VB6的运行速度也相当快,并且可以在许多相当古老的硬件上运行。

Don't get me wrong, I'd never choose to use it, but for those who use it day to day it offers overall simplicity and flexibility that few mainstream languages can match. - grandalf

不要误会我的意思,我永远不会选择使用它,但是对于那些每天使用它的人来说,它提供了总体上的简洁性和灵活性,几乎没有主流语言可以匹敌。 -爷爷

and the obvious followup...

以及明显的后续行动...

The irony is, [today's] Ruby "rockstar ninjas" are doing exactly the same work that used to be done with VB and Access. - gaius

具有讽刺意味的是,(今天)Ruby“ rockstar ninjas”正在做与VB和Access完全相同的工作。 -高斯

This is true...20 years later and it's all still text boxes over data. Even the most advanced client side JavaScript single page apps are often shadows of their terminal and text mode grandparents.

这是真的... 20年后,它仍然是数据上的文本框。 即使是最高级的客户端JavaScript单页应用程序,也常常是其终端和文本模式祖父母的影子

Ruby does feel in some ways like the VB of two decades ago. Quick, is this Ruby or VB6?

Ruby在某些方面确实像二十年前VB 。 快速,这是Ruby还是VB6?

class MyClass  
def describe
print self.class
end
end

What about Fibonacci?

那斐波那契呢?

Public Function Fib(ByVal n As Integer) As Integer
If (n < 2) Then
Fib = n
Else
Fib = Fib(n - 1) + Fib(n - 2)
End If
End Function

Of course, Ruby can do it with a ternary operator.

当然,Ruby可以使用三元运算符来实现。

def fib(n)
n < 2 ? n : fib(n-1) + fib(n-2)
end

And VB6 has only IIF() for that so we get this

VB6仅具有IIF(),所以我们得到了

Public Function Fib(ByVal n As Integer) As Integer
Fib = IIf (n < 2, n, Fib(n-1) + Fib(n-2))
End Function

Sure VB6 had/has its problems, but this was a great environment a LONG time ago and even though a lot of unskilled people created a lot of crap, a lot of skilled people created a lot of useful apps that are still running today. And I understand why.

虽然VB6确实存在/有问题,但是很久以前这是一个很好的环境,尽管许多不熟练的人创造了很多废话,但许多熟练的人却创造了许多仍在运行的有用应用程序。 我知道为什么。

The things that Visual Basic 6 did still need doing. - David Platt

Visual Basic 6仍然需要做的事情。 -大卫·普拉特( David Platt)

Disclaimer - I currently work for Microsoft on the Web Team but this post has nothing to do with that. I have worked here about 5 years but I worked elsewhere for much, much longer. I dabble in Ruby and other languages on the side so don't get my grudging respect for Visual Basic 6's special brand of cheesy pragmatism twisted.

免责声明-我目前在Web团队中为Microsoft工作,但与此无关。 我在这里工作了大约5年,但是我在其他地方工作了很多长时间。 我侧重于Ruby和其他语言,所以请不要对Visual Basic 6特殊的俗气实用主义品牌感到沮丧。

翻译自: https://www.hanselman.com/blog/visual-basic-6-ruby-and-getting-off-my-lawn

 类似资料: