8
votes

I'm reasonably familiar with the various forms of VB that existed prior to .NET (VB6, VBA, VBScript...), but have yet to delve into The Sweet New Flavor that is VB.NET.

So I would very much appreciate it if someone would provide a quick summary of the major differences in the language brought about by VB.NET.

6
what makes you ask such a wide question? And, answer it as well?shahkalpesh
Nothing wrong with answering you own questions. It's actually encouraged. You just want to be sure you have a very good answer when you do so, and that you leave a chance for the community to also provide input. It's also good etiquette on SO to make your answer (not the question) community wiki.Joel Coehoorn
@sakthivignesh: i think you caught a lot of flack for this by writing such a vague question and then immediately posting a very inadequate answer to it. In the future, you'll want to avoid this unless, as Joel notes, you know you have a good answer. Instead, spend more time writing a good question...Shog9

6 Answers

10
votes

Assuming when you say vb you mean vb 6. Pretty big. The original visual basic does not use the .net runtime environment, and although they have similar names, they are pretty much too different languages. Visual Basic is not fully object oriented, but VB.net is. Error handling is vastly different between the two. VB.Net has try catch blocks where traditional vb uses On Error GOTO statements. These are just a few differences. The list goes on and on.

Here is a link describing the "Visual Fred" Name.

7
votes

Oh the horror.

Sorry, but all existing answers are wrong in some way or another. Joel’s is actually the best of the bunch but its poor wording encourages misunderstanding (sorry, Joel – but just look at your comments!):

contrasting VB.Net with VB is not possible, because they are the same thing.

That’s exactly like saying that “contrasting apples with fruits is not possible because they are the same thing,” and as such not very helpful; especially since many people (still) use “VB” synonymously with “VB6.”

So, to clear things up a bit: both VB6 and VB.NET are dialects of the Visual Basic language family (let’s call it that). Their resemblance is superficial at best; someone who has actually used them both (and not only looked at some source codes) will have noticed that apart from a cursory syntactic similarity, they are completely different beasts. Using them are fundamentally different experiences.

The only aspect in which they actually resemble each other (apart from said syntax similarity) is that they both are very well suited for rapid application development (RAD) … at least until you’ve tried dynamic languages such as Python or Ruby in combination with GUI agile frameworks such as Shoes. But even as RAD environments go there’s a huge difference.

VB6 was basically developed to do RAD, nothing else. And in its time, VB6 was the best thing on the marked to do RAD, by a large margin. VB.NET, on the other hand, was not singled out for RAD development – any more than C#. Both are high-end languages backed by a general-purpose framework, much like Java but with the aspiration to improve on some of Java’s faults, such as its over verboseness by cutting a lot of boilerplate code (introduction of delegates, events, properties, operator overloading, autoboxing to name but a few such features).

And while VB.NET is to a large degree backwards compatible, this is very misleading. First off, no sane person would say that C and C++ are the same languages just because a lot of C programs compile fine on C++ compilers. The differences between VB and VB.NET are even bigger by some metrics because no complete VB6 code is valid VB.NET. It needs an automated “upgrade assistant” to produce valid .NET code, and experience has shown that this upgrade assistant is unsuitable even for medium-sized projects, mainly because its literal translation breaks many guidelines and assumptions of the .NET world.

Saying, like Kibbee, that the compilers of VB6 and VB.NET are “basically the same” is flat out wrong. Likewise, claiming that “the .Net runtime is not a change to the language” misses the point completely. Of course it’s a change in the language. VB.NET was completely build around the .NET framework, it’s not just any other library.

He claims that

If VB.Net was meant to be a new language, and not just a new version of an old language, they would have got rid of "On Error Goto" which they didn't.

– which is likewise misleading. “On Error Goto” was included solely for backwards compatibility (the upgrade assistant cannot convert old-style error handling into exception-based error handling).

Let me sum up the main point of this rather long posting so it doesn’t get lost: Just like Java and JavaScript, VB6 and VB.NET have very similar names (and for very much the same reason, too: marketing) but this is entirely misleading. There are a few syntactic similarities. Apart from that, superficially as well as under the hood, they are completely different languages.

5
votes

VB.Net is just the version of Visual Basic intended to work with the .Net framework. It also makes other changes and additions to the language, but contrasting VB.Net with VB is not possible, because they are the same thing.

What you can do is contrast with VB.Net with VBA, or VB6, or VBScript, or some other variant of Visual Basic. But VB.Net still IS one possible variant of VB. In fact, if you look at the language part of the product by itself, they're now calling the latest version VB9, with VB10 due out later this year.

In the same way, you can't contrast "Pespi" and cola, because Pepsi is a cola, but you can contrast Pepsi and Coke.

That said, the VB.Net dialect of VB brings a significant number of changes and improvements to the language, including true support for object oriented and functional paradigms, to the point where idiomatic VB.Net code is often very different from VB6-era code.

2
votes

There are quite a few - too many to list I think. You could almost consider VB.Net a completely different language that shares some similar syntax to VB. The biggest change is becoming familiar with the .NET classes.

1
votes

VB.Net is a newer version that uses the Dot Net Framework / managed code.

VB is the old version.

1
votes

VB compiles to p-code or native code, VB.net compiles to MSIL. Also the syntax differs a bit. As VB.net is the upgrade path for VB users and programs, there are a bunch of helper objects and functions that makes moving code from VB to VB.net easier, these objects and functions aren't normally used in programs written in other .net languages.