Visual Basic 6, Ruby and Getting Off My Lawn
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.
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
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++.
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
A Hacker News discussion started up around this article and one HN'er said what I've been saying for years (emphasis mine):
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 is also quite fast, all things considered, and runs on lots of fairly old hardware.
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
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.
Ruby does feel in some ways like the VB of two decades ago. Quick, is this Ruby or 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.
def fib(n)
n < 2 ? n : fib(n-1) + fib(n-2)
end
And VB6 has only IIF() for that so we get this
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.
The things that Visual Basic 6 did still need doing. - 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.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
VB is very verbose - I don't really see the same correlation you do.
You really think this:
def fib(n)
Is similar to this:
Public Function Fib(ByVal n As Integer) As Integer
?
The key thing about VB6 was that its IDE was pioneering, outshining anything around at the time, as far as I know. The language itself, however, was a hack (with good (OLE)COM support nonetheless) and I was so glad to ditch it and move to C# when the opportunity arose.
I have fond memories of VB6.
I working on reporting for manufacturing solutions coded in .Net, however VB6 is still the best way (quick/nasty) to interface with some very primitative COM based dll's for some of the hardware.
Superficial or not, the fact is VB6 doesn't have brackets or semi-colons or return statements. In fact, after a drink or two, it even starts to look-and-feel like duck typing. It even has support for object oriented programming.
Seriously...Nothing to see here!
But programming in it, especially if you had any C++ and OO knowledge felt somehow dirty; there was no inheritance for example. The thing which turned me off forever was when I ran up against the VB6 control limit - the number of unique controls that could appear in a window; it was something like 200, but there was a workaround to add them to an 'array of controls' or something. The whole language felt like a gigantic kludge.
http://www.cooper.com/alan/father_of_vb.html
By the way, classic ASP with VBScript should still work on Windows Server 2012 or even Windows Azure right?
VB6 in Visual studio would be very good.
You can already code PHP and Ruby in VS, so...
I will never be able to forgive VB for spawning VBA. VB wasn't a true object orientated programming language and it's ugly step sister VBA wasn't even supported by a proper development environment.
How many simple VB/VBA systems turned nasty once they started to grow?
even though a lot of unskilled people created a lot of craplet's us not forget Sturgeon's Law
90% of science fiction is crap because 90% of everything is crap
I was just thinking about doing a simple Metro app and really missing the simplicity of VB and windows forms. Where is the tool that hides all the XAML stuff. I don't want to have to jump into writing XAML or use Blend in order to get simple things done.
I do wonder if we are going backwards.
Martin
In another project, using Subclassing, I wrote an app that allowed our estimators to load up an image (pdf, tif, bitmap, jpg, pretty much anything) of the building we were bidding on building. It had real-time viewport functionality, allowed you to draw transparent lines over the top of the drawing in all sorts of patterns and colors, measured those lines, scaled it up to real world lengths and allowed our estimators to quickly bid multi-million dollar jobs.
And it was fast. I mean, it beat the pants off of anything you could buy on the market for under $1000 a copy. I was able to drop down into Device Contexts, create brushes, etc, all without the help of DirectX or GDI+ or anything. Merely using BitBlt and the Win32 OS level GDI functions and objects.
Don't let anyone tell you that you couldn't do something in VB6 (and 5, really). I mean from the End User's perspective. If a program does task X, then it's a success.
The IDE was incredible. You could pause code execution, write code, and continue on right there. No mocked up Edit and Continue, no annoying message boxes about how you can't edit running code, etc.
I love .Net. The IDE is even better than VB6 in almost every way. The language features and extensions are fantastic.
But programming in C# over VB6 does not make you a more competent programmer.
1) Editor inheritance - No real way to do inheritance other than copy-pasting method implementations or making private instances of the base class in the derived class and calling methods against that.
2)Strings and Variants - Man, if you really needed to do heavy duty string parsing, VB6 was not your man. You had to dive into the undocumented things like StrPtr and VarPtr and use the Win32 API.
http://msmvps.com/blogs/bill/archive/2012/06/12/why-a-little-bit-of-vb-is-a-bad-abd-thing.aspx
Noone can deny the power of web applications, and SOA, and all these things of course, but the way we develop them today is still hideous.
We're still waiting for "real" edit and continue after what eleven years of .NET..... ;)
Some days I miss Mort....
http://vb.mvps.org/vfred/Trust.asp
I wrote many other applications in VB6 that generated so much profit for our company in hours saved. I still dabble with the VBA IDE in Word and Excel just for the time savings it has over .NET.
Who's been programming Windows 8? --- some hands.
Who's been programming in .net? - - - lots of hands.
Who's still programming in VB6? - - - My hand was the only one left in the air. :-\
(and they all moved away from me.....)
:-)
As far as VB6 goes, at my current place of employment, I am supporting several VB6 apps that have been around since VB6 was first released. Do I like it? No, but I don't hate it, per se. Are we having trouble supporting them? Oh, yes, that's why we are rewriting them in WPF and .NET 4.5. We are finding it more difficult find VB6 developers...
On the other hand, while Ruby has several advantages, when dealing with databases I will always prefer Access VBA. It is just simpler, self contained... and faster if you compare it with Ruby's ActiveRecord.
Comments are closed.