Results 1 to 8 of 8

Thread: Vb7?

  1. #1

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611

    Vb7?

    What is the relationship between VB7 announced on this site

    http://www.vb-world.net/articles/vb7/index2.html

    and VB.net?
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    VB7 is VB.Net

  3. #3

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    Originally posted by Joacim Andersson
    VB7 is VB.Net
    but there ids no upgrade path - you have to re-write VB6 code?
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by Kzin

    but there ids no upgrade path - you have to re-write VB6 code?
    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.

  5. #5
    New Member
    Join Date
    Nov 2001
    Posts
    15

    Question To Joacim Andersson

    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

  6. #6

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    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.
    Which bits of code tend to need most re-writing?
    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    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
    Well, I agree that VB.Net is a bit more like Java then it has been.
    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:
    VB Code:
    1. Dim s As String
    2. MsgBox("Hello World".IndexOf("World"))
    3. s = 75.toString()
    4. MsgBox(s)
    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).
    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.

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Originally posted by Kzin
    Which bits of code tend to need most re-writing?
    Well much of the code the upgrade wizard makes for you will be runnable but it uses the Microsoft.VisualBasic.Compatibility namespace extensively.
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width