By Mike Griffiths.
Visual Basic 7, what's that- I thought we had VB.NET?
For newcomers to VB and for those with a short memory - Visual Basic 7 was announced as the next version of Visual Basic long before the rumours of C# and .NET began to circulate. VB 6 had done a lot to further the development of VB5 and VB7 was expected to complete the process of fully exposing the functionality of classes within the established Visual Basic language and IDE.
Visual Basic was born out of a creation called "Ruby" written by Alan Cooper. Ruby was like a rectangular work-slate upon which graphical objects could be dropped and combined to act as a graphics shell for an operating system. Ruby was sold to Microsoft in early 1988 and after a couple of false starts became the basis for the development of Visual Basic. It was the launch of VB that persuaded me (at the time the IT manager of a £200M public company) that Microsoft's Windows was the right platform to realise my ideal of a PC on every desk. It may be hard to remember but there were rival GUI's and Apple were doing well with the Mac. Version 2 arrived before we had completed our first large development project and that was followed by the masterful version 3 which became my tool of choice when I decided to stop being a salaried employee and go freelance. Personally I skipped version 4 but plunged headlong into version 5 as it delivered so many things I needed as well as breaking out of the 16 bit straight jacket.
Microsoft clearly understood the importance of VB within the scheme of things. An effective and rapid development tool was an essential requirement for a dominant desktop operating system. Remember Apple had the first reasonably stable GUI but they neglected the developer tools and I think that probably lost them the race - even though their reluctance to release the stranglehold on the hardware was probably nearly as important.
With versions 5 and 6 of VB I was able to create DLL's and call them from Active Server Pages thus helping my clients build applications with an intelligent Internet interface. We already had database access and we could build great scaleable, multi-tier, multi-user systems. We started using XML and liked the look of SOAP as it could solve so many of the version problems we had with COM objects. So why isn't this long term VB fan promoting the features and new ideas of VB.NET?
My disenchantment was pretty near immediate - no control arrays! One of the foundations of good object oriented code that had arrived in VB3 was gone. I had long suspected that the developers at Microsoft did not really understand the power of being able to create any number of controls on the fly at runtime with all of it's events and properties being handled by pre-existing and tested code. Here was confirmation. VB.NET was supposed to be object oriented yet it had lost a key object oriented facility - indeed I suspect it could not be offered within the context of the range of VS.NET languages forced to use a common runtime.
[Actually you can create controls on the fly in VB .NET and attach them to existing event handlers but it's a pain.]
So I bit the bullet, decided that a practical alternative to control arrays could hopefully be evolved and continued to explore. As I built applications and saw the automated creation of classes to support the forms and components I added I began to realise that what I was looking at was Java with the syntax of a Basic language. Given the history of the .NET project I should really have been expecting it, but it came as a revelation. Now I am not a big fan of the inelegant C++ syntax of Java (is this guy never happy?) so I should be pretty excited by Java as VB. Well potentially yes, if it could be packaged and distributed like Java and especially if it would run across the range of platforms like Java. Unfortunately VB.NET exhibits none of the features of Java (except the safe virtual machine) that make Java the tool of choice for so many.
How about "Garbage Collection"? Sold in VS.NET as relieving you, the programmer, of the task or managing the memory usage of your objects. Errm, just who is let off the hook when it comes to proper memory management? Now I have some sympathies for the guys at Microsoft - memory management is difficult stuff - but I also remember that NT was designed by some of the team responsible for Digital's VMS operating system. VMS machines stay up for years! They do not leak memory and do not need a re-boot every couple of days. So was the plot lost somewhere between NT version 3.1 (was I the only one running that?) and now?
You probably do not realise just how great the code debugger built into the VB IDE is but - just wait until you lose it in an IDE that can't let you step through code, making adjustments to variables and to whole blocks of logic as you proceed. OK it's still a whole lot better than what a lot of other developers have to work with (try C under Linux) but it is not an improvement on what you have.
Now the killer. If you make all or part of your living writing code that pushes the boundaries in some way then you are going to want to keep just how you do it to yourself. You invested your time and intellect in acquiring certain skills and techniques - this is what you sell. You would be mad to give that body of knowledge away in a program module that can be de-compiled by anyone to C# thus revealing your secrets to all. The uncharitable would suspect that the code gurus at Microsoft just don't believe that special skills exist outside of the Redmond campus - they fight hard to protect their own investments but care little for yours.
Some minor problems with VB syntax might have been dealt with in the Basic/Java fusion that is VB.NET but were not. As an example, I find it slightly annoying that bitwise and logical ANDs and ORs use the same syntax although we (thankfully) have an unambiguous string concatenation operator (&). I have learned to treat an If statement containing the phrase "And Not (some condition)" with the deepest suspicion - you just know that you are looking at a bug waiting to happen. Java uses && for a logical AND while a single ampersand is used for a bitwise AND - but disappointingly VB.NET stuck with the original.
What is your major criticism of Visual Basic? Probably it is the need to install the fairly bloated runtimes and components required by a VB .exe to run. But just take a look at the problems you are going to have distributing a .NET application to desktop machines or networked servers. Is a single CD going to be big enough? DVD distribution kits? My clients desktop operating systems stretch from Windows 95 through all of the 9x variants to NT4, 2000 and XP. There is also NT Terminal Server edition and the Citrix versions of the same. Perhaps your business or your customers always upgrade to the latest OS so you could conceive of implementing .NET runtimes but most businesses are going to take some persuading.
Provided the tools we use allow us to produce well behaved programs the business users of our code do not really care what it is we use to develop them with. They like us using Visual Basic because we can develop our applications quickly and efficiently - reducing development and testing time and therefore costs. Now consider the cost and disruption we would have to bring about in order to implement applications using the .NET development tools. Our clients would rightly ask why? Then they would ask if there was anything else we could use instead. Even the most fervent .NET fan would find these difficult questions to answer.
So what is VB.NET for? I think that VB.NET makes it marginally easier to develop web based applications where you would otherwise apply active server pages and DHTML - provided you can find a server that will run the code of course. Visual studio .NET is supposed to be the toolkit for developing web based services and to thus provide a wholly new infrastructure for delivering applications, new services and inter-business processes. Call me an old Luddite if you like but I am not about to advise one of my clients to risk their business to a web based service. They would not listen and would very properly fire me. They have invested in duplicate computer rooms, redundant frame relay based networks and mirrored servers all designed to sustain them during predictable breakdowns and glitches. Base a key operational system upon the availability of a remote Internet server? Ignoring DOS (denial of service) attacks and the power of the courts to allow injunctions closing web sites upon the flimsiest of evidence - we have to expect some suppliers to go bust or be acquired. Your supplier closes it's doors and suddenly you can't process your customer's orders. The .NET application model is fundamentally flawed as it applies to business and any critical or important business process.
OK The Joke is over Mr Gates. The software developers who made such a substantial contribution to making Microsoft Windows the dominant operating system family on the planet would now like an upgrade to their favourite development tool. Visual Basic 6 was incomplete in certain key object oriented areas and there is quite a long list of known bugs to fix. Now is the time to dust off the VB7 development and get it back on track so we can keep building top class desktop and networked applications.
Oh, and if you could just let us have the option of compiling and linking to a stand-alone executable as well I, for one, would be just about content. It would at least stop the Delphi developers from sniggering.
A positive word for VB.NET? Viewed dispassionately, VB.NET stripped of the bloat and overheads of the .NET infrastructure would not be a bad language in itself. It is nicely structured and applies the "class" based approach to development reasonably well. Without the massive .NET overhead and with a safely compiled executable VB.NET could become a hit with developers. Oh and the icon editor is great but I think that installing Visual Studio .NET just for that is a bit over the top.