Saturday, September 17, 2005

So You Think Visual Basic Is A Wimpy Programming Language?

Yes, hardcore programmers sometimes look down on their Visual Basic counterparts. Aren't those the guys who never have to deal with pointers, dynamic memory allocation and multithreading, and who are writing code in a language that was intended for novices (hence "Beginner's All-purpose Symbolic Instruction Code"). Those who use an interpreter whose roots go back to Microsoft's first product, Altair Basic? Hey, not so fast! I know Java and .NET developers who have no clue about pointers, dynamic memory allocation and multithreading either, and are easily outperformed by VB veterans.

Last week I introduced a Visual Basic programmer to MSXML, and prepared some code samples so she would have something to start with. And it's true, the VB6-syntax is partly bizarre. Let alone the Visual Basic IDE which pops up an error messagebox each time I leave a line of code that does not work yet (although I am sure there should be an option to switch off this annoyance). It also has the same usability charm as back when it was introduced on 16-bit Windows. The API is quite limiting as well, so the first thing I had to do was to import several Win32 functions.

Let's face it, legacy applications done in Visual Basic can turn into a CIO's nightmare. A huge number of little standalone VB applications have emerged during the last fifteen years, fragmenting corporate software infrastructure. VB applications are often hard to maintain because of the lack of structured programming the language enforces, VB6 itself is a dead horse and the migration path to VB.NET is tedious.

Legions of VB programmers are supposed to switch over to VB.NET those days. VB.NET does not have a lot in common with the old platform but some syntax similarities. Not only do those programmers suddenly have to grasp OOP, they must also get to know the .NET framework as well as a completely different IDE. BTW, I really dislike the VB.NET syntax. Just compare the MSDN VB.NET and C# code samples. C# is elegant (thanks to MS distinguished engineer Anders Hejlsberg), while VB.NET is nothing but an ugly hybrid.

Another story comes to my mind: a friend of mine, expert on Linux and embedded systems, once went to work for a new employer. He knew they were doing some stuff in Visual Basic. Then one day someone sent him a Powerpoint file. My friend was wondering what it was all about, as the presentation itself was empty. "No, it's no presentation, it's our codebase", the other guy answered. They had done their stuff in Powerpoint VBA. Unbelievable! Needless to mention, my friend left that company shortly after.

So if you want to know my opinion: Visual Basic might be wimpy, but in some perverted way it's for the real tough as well.