Tony Davis

Simple-Talk Editor
News, views and good brews

VB.NET: The Ugly Duckling

Published Tuesday, July 08, 2008 11:35 AM

One of the greatest pleasures of programming in C# is that wonderful, giddy, feeling of superiority one has over VB.NET programmers. In C#, one has a vague awareness that what one is doing has elegance and style. It must be the effect of the curly braces. By contrast, VB.NET steadfastly maintains its status as the 'ugly duckling'.

 

Is this really justified? After all, a routine that is programmed in any of the.NET Framework languages will be compiled to almost the same IL opcode sequence and the JIT-compiler will produce very similar CPU instructions: Therefore, VB.NET is likely to be as fast as C# or any other .NET Framework language. It is also just as versatile: after all, Microsoft used it to write the Silverlight JavaScript compiler, and the current VBx (VB 10) compiler was written in VB.NET.

 

The negative perception is due, in part, to the fact that the first 'DotNet' version, Visual Basic.NET 7, gave every appearance of having been slapped together in a big hurry. It had fewer features than VB 6, and abandoned VB's greatest asset: that of being a dynamic language for rapid application development. Despite this, Visual Basic became the most popular .NET language (Heffner 2005, Forrester Research) with over twice as many users as C#. Visual Basic Express Edition is by far the most popular download and all indications from postings in blogs and forums is that Visual Basic is the most popular of the DotNet languages. Of course, there was already a large reservoir of skilled VB programmers in the industry, but given that by 2005 most VB programmers had long ago added C# to their skill-set, its continued popularity indicates that VB has an appeal all of its own.

 

VB 8 quietly and steadily closed the gap on C# and VB 9, the current version, introduced all sorts of useful features such as XML literals, XML axis properties, and Smart Query expressions. The forthcoming version, Visual Basic .NET 10.0 (VBx), could be the release that finally cures its inferiority complex once and for all. It uses the Dynamic Language Runtime (DLR) so can be used for application scripting, just like VBScript and VBA. It also allows dynamic methods and type generation. Use of the DLR makes late' or 'dynamic' binding almost as fast as static binding, and fully returns VB to the immediacy that VB 6 had as a quick way to get scripting done.

 

We all love Java and its cousin C#, of course, but once the Dynamic Language Runtime, and the corresponding Da Vinci Machine, are perfected, I suspect the language debate will change. Both the Java Virtual Machine and .NET have, so far, constricted the effective choice of development languages because they didn't support dynamically-typed languages such as Python and Ruby. Once this is fixed, it will result in greater choice and allow the programmer to choose the language that best fits the task in hand, rather than the one best honed to the inherent limitations of the framework.

 

Cheers,

 

Tony.

Comments

 

Patrick Index said:

I don't know about you Tony but I have long given up trying to keep abreast of all the language offerings from Microsoft.  Unfortunately sometimes I am forced to do "a bit of" vb.net/vba.net or whatever the hell it is in SSIS and then switch and do some c# for a clr assembly.  Meanwhile I then fret about getting hold of a fully licensed version of Visual Studio (another classic case of Microsoft bloatware) and spend the next few hours trying to install it.

There is another much more straightforward and satisfying way to program.  Download Eclipse IDE and program in Java and just try to become a good programmer in one language, Java.

I don’t believe any of the Microsoft offerings were really necessary apart perhaps from classic VB.  

Can’t see the point of J++, vbscript, c#, vb.net to name just a few?

Anyone agree?
July 9, 2008 6:13 AM
 

randyvol said:

Hey Tony -
Could not agree more.  

The thing people ought to understand about Microsoft is that once they decide they're committed to something, they will just keep putting out release after release of incremental improvements until one day that 'inferior' product has the majority market share.

Besides, as you point out, if the underlying op instructions are as efficient, who really cares what you code in?  That is the point of the CLR isn't it?
July 9, 2008 6:26 AM
 

philm said:

Like many others, I've come up from the VB world through VB3 to VB6 to VB.Net.
I learned how to read C# because most examples everywhere were in C#. I think the main reason I prefer VB to C is readability. It is slighly more verbose, for absolutely no performance penalty. Losing the curly braces, which are typically replace by an END statement (e.g. END IF) helps make it more clear what the programming chunks are.
This helps solve my biggest programming problem, which is not writing the code in the first place, or anything like that, but quickly picking it up and following it a year or so later when changing requirements dictate.
So I write all my code as if someone else had to read it, and I make it self-explanatory, and if there are slight performance hits because it wasn't as tight as it could be, well then, so be it.
July 9, 2008 6:50 AM
 

Phil Factor said:

I've spent many years programming commercially in VB. It is quite good enough for me. I've never reached the point where something I've wanted to do has proven impossible because of a restriction in the language.

I'm not fussy. I'll program in anything that someone is prepared to pay me to program in, even Perl or PHP.

I'f I'm programming for the sheer pleasure of it, then I use whatever gives me the quickest result. Often, that's VB  The important thing is that Microsoft doesn't ever again deviate from giving VB the attention it deserves.
July 9, 2008 9:09 AM
 

Dew Drop - July 9, 2008 | Alvin Ashcraft's Morning Dew said:

July 9, 2008 10:07 AM
 

Steve Russell said:

Tony,
This was a very eloquent and edifying post.  This is an argument that I have made to the various C# snobs I have known.

Most shops choose to specialize in one syntax simply for uniformity.  If you have C programmers use C#.  If you have VB programmers use VB.

Admittedly I am a VB purist, but I have added C# to my skill-set.  The wider you cast your net, the more chance you have of catching fish.  I personally find C# less easy to read than VB.  The curly braces are just not good demarcations.  Call me stubborn, but I also prefer the sub / function distinction.  And the list can go on and on.

When you get right down to brass tacks, for the average solution you can use either. It is just syntax.
Sincerely,
Steven M Russell
July 10, 2008 8:36 AM
 

Daniel Penrod said:

Patrick Index,

Are you serious?  Java over .NET?   I have done both for years and have not made one Java application that I couldn't have made in .NET C# 10 times faster with 10 times less code.  
July 11, 2008 7:55 AM
 

glenfitch said:

I've been writing in Java too. I think that Patrick Index is saying he wants to program in java in much the same way that despairing people threaten to jump off Brooklyn Bridge. It is a cry for help, rather than a logical and thought-out escape from his difficulties.
No, we need to cherish him and introduce him to the happy world of VB 9. Patrick, forget these Black Java Thoughts! Come back to VB.
July 11, 2008 1:50 PM
 

ThomasMick said:

Tony,

Your writing style is refreshing; I've been reading way too many articles from people who obviously use english as a second language. I also agree with you about the bad rap VB has gotten over the years; most of the developers I work with could be classified as C# snobs.

Keep writing!
July 15, 2008 12:13 PM
 

UIT said:

@Patrick Index

Couldnt agree less.  I have not had one good experience installing or running Java programs in my life.  I am talking, across multiple desktops, laptops, you name it.  Whenever a java applet is required to run, I cringe because I know the browser is going to come down and take down the rest of my stuff with it.  Even non-browser java.  

For me, I used VB6 until just a few months ago and now I am going full steam into VB.NET 2008.  I have no interest in learning Java or C++ or any 'beans' or whatever its called.   I make darn good money with Microsoft tools and though its tough to keep up with them at times, it certainly does show when that invoice is paid.

I've been developing software since the late 1970's and I must say, Java is one thing I wish I'd never see again.  And I've had my hands in COBOL and PL/1, JCL and the rest of that other stuff as well.  Java loses in my book.
July 16, 2008 2:19 PM
 

Booby said:

A programmer is not defined by the language they use but the results of their development.  I have used VB because it allowed me to spend more time on developing the logic and was not as strict about syntax.  I am currently using C# for a development and like it just fine once I get the syntax correct.

Was I a real programmer when I was writing Assembly programs on 80 column Hollerith cards?  How about when I was writing Fortran or COBOL or C or Clipper or dBase or a IDEAL?  Was I a real programmer because I used IBM, or Advanced Data Research or Ashton-Tate, or Nantuckett or ANSI compatible or Microsoft or open source?

The answer is all of the above if the systems I developed meet the requirements of my users.  I am still propping up an app I wrote 11 years ago in VB5 using and Access 97 database.  To the users it is a "real" program.

By the way we are using C# and WPF to replace this old app so one of the constants I see to being a "real" programmer is adapting to change.
July 28, 2008 9:21 AM
You need to sign in to comment on this blog

















<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
Go With the Flow
 Knowing enough about the routes that messages take is vital to being an effective Exchange admin,... Read more...

When Email Collaboration Could Have Changed History
 In our mission to make history relevant to the busy IT executive, we speculate how Email might have... Read more...

Bunnikins!
 When an IT manager is selected as a victim of office politics of a large corporate, it is time for him... Read more...

Exchange Database Technologies
 One of the most misunderstood technologies in Exchange Server, regardless of its version, is the... Read more...

Top Tips for Exchange Admins
 Michael Francis hands out imaginary Olympic medals to the winner of the August 'Top Tips for Exchange... Read more...