What is the relationship between VB7 announced on this site
http://www.vb-world.net/articles/vb7/index2.html
and VB.net?
Printable View
What is the relationship between VB7 announced on this site
http://www.vb-world.net/articles/vb7/index2.html
and VB.net?
VB7 is VB.Net
but there ids no upgrade path - you have to re-write VB6 code?Quote:
Originally posted by Joacim Andersson
VB7 is VB.Net
Well, yes and no. There is an upgrade wizard that is invoked if you try to open a VB6 project.Quote:
Originally posted by Kzin
but there ids no upgrade path - you have to re-write VB6 code?
IMHO this wizard isn't very good though and you'll still have to rewrite a lot of the code.
VB.Net is rewritten from the ground up so it's basically a complete new language which isn't backward compatible with earlier versions of VB.
Joacim Andersson, I note you are Sun Java Cert. and should think you are qualified to answer this:
Do find that the VB.NET's new bits are very similar to Java concepts - and have you noticed any new stuff which is new to both?
Cheers
Which bits of code tend to need most re-writing?Quote:
Originally posted by Joacim Andersson
Well, yes and no. There is an upgrade wizard that is invoked if you try to open a VB6 project.
IMHO this wizard isn't very good though and you'll still have to rewrite a lot of the code.
VB.Net is rewritten from the ground up so it's basically a complete new language which isn't backward compatible with earlier versions of VB.
Well, I agree that VB.Net is a bit more like Java then it has been.Quote:
Originally posted by VBwriter
Joacim Andersson, I note you are Sun Java Cert. and should think you are qualified to answer this:
Do find that the VB.NET's new bits are very similar to Java concepts - and have you noticed any new stuff which is new to both?
Cheers
At least in the concept of class encapsulation and that VB.Net is a true OOP language.
In a way I would say that VB.Net can even be considerat to be even more OO then Java is.
Because of the fact that everything in VB.Net is an object.
Even primitive data types and literals are objects.
Take this bit of code for example:As you can see I use the IndexOf() method of the literal string "Hello World" to find the index of "World" (this is sort of the equal to the InStr function).VB Code:
Dim s As String MsgBox("Hello World".IndexOf("World")) s = 75.toString() MsgBox(s)
I also use the toString() method of the Integer literal 75.
In Java you can call methods on string literals since String in Java is a class but you can't consider an int as a class.
You would need to use the wrapper class Integer for this.
In VB.Net you still have code modules though, which isn't classes so you can still write non OO code.
In Java you can do the same by declaring method as static so even though the code is inside a class definition the code isn't actually part of the class.
It's just an extension of the namespace.
Well much of the code the upgrade wizard makes for you will be runnable but it uses the Microsoft.VisualBasic.Compatibility namespace extensively.Quote:
Originally posted by Kzin
Which bits of code tend to need most re-writing?
By using this namespace you lose a lot of the power of the framework.
If you use any VB6 graphic methods like Line, PSet, Point and so on, none of this code is translatet so you have to rewrite it yourself.
The same thing happens if you use the Clipboard object.
Code that you use to open files will not be translated.
The Open statement and file functions like Input #, Write #, Put, Get and so on will still run since they exist in the compatibility namespace but you lose a lot of power since you don't use the different Stream objects in the .Net Framework.
Also the upgrade wizard turns Option Strict off.
And it will not even try to translate any On Error Goto code.
On Error Goto and On Error Resume can still be used in VB.Net and I think that the only reason Microsoft kept this crap in VB.Net is because of the Upgrade Wizard.
I talked to a lot of people that uses the upgrade wizard just to learn how to use VB.Net.
I think this approach stinks since the code it creates isn't that very well.
Personally I will use VB.Net mostly to create new projects and I will continue to use VB6 to maintain my old code.
Best regards