Results 1 to 29 of 29

Thread: VB Runtime Functions

Hybrid View

  1. #1
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    Re: VB Runtime Functions

    MsgBox is native .NET. It was written in .NET and only executes .NET code when run. It just has syntax which is the same as the previous non-.NET function.

    I don't understand why any of these would be 'bad'. If you are using Visual Basic .NET then why avoid the Visual Basic namespace which in part makes it VB?

  2. #2
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: VB Runtime Functions

    Quote Originally Posted by Edneeis
    MsgBox is native .NET. It was written in .NET and only executes .NET code when run. It just has syntax which is the same as the previous non-.NET function.

    I don't understand why any of these would be 'bad'. If you are using Visual Basic .NET then why avoid the Visual Basic namespace which in part makes it VB?
    I want to chime in here, as I sort of agree with both of you..
    These functions are a part of VB, and to say theyre bad bad bad, isn't fair.

    However, users should be encouraged to learn and perform the true .NET way for one reason, it will allow them to be learning the c# way at the same time, if someone does use all the vb functions they will get a big shock when theyre all suddenly gone in c#, this is the reason they should be avoided.

    I myself often use MsgBox() when debugging vb code, it's quicker to slap in isn't it? as I already understand it's a vb alias, there's no reason I shouldn't do so. and Hex() is certainly a nice shortcut.

    If MS were to do anythig at all, i'd suggest the compiler simply give warnings on using legacy support functions (warnings that can be surpressed of course) rather than remove them, they do provide a good start for vb backgrounded people to use .net

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: VB Runtime Functions

    This sounds like a fantastic idea to me:
    Quote Originally Posted by Phill64
    If MS were to do anythig at all, i'd suggest the compiler simply give warnings on using legacy support functions (warnings that can be surpressed of course) rather than remove them, they do provide a good start for vb backgrounded people to use .net
    Having that would mean that people who are in the process of upgrading from Classic VB can import/write code without such a big learning curve, and convert the code (and themselves!) to the 'right way' as they get the time - which would of course be easier if the warnings contained a reference to the correct alternatives.

    It would be even nicer if this was done using a collapsible group (called something like "Legacy functions to be upgraded"), so that the group can be ignored while correcting other issues.


    A good alternative to this would be a separate downloadable tool (perhaps as an addin, but that wouldn't help Express Edition users) which reads the code files and gives those warnings/recommendations as appropriate.

  4. #4
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: VB Runtime Functions

    Quote Originally Posted by si_the_geek
    This sounds like a fantastic idea to me:Having that would mean that people who are in the process of upgrading from Classic VB can import/write code without such a big learning curve, and convert the code (and themselves!) to the 'right way' as they get the time - which would of course be easier if the warnings contained a reference to the correct alternatives.

    It would be even nicer if this was done using a collapsible group (called something like "Legacy functions to be upgraded"), so that the group can be ignored while correcting other issues.


    A good alternative to this would be a separate downloadable tool (perhaps as an addin, but that wouldn't help Express Edition users) which reads the code files and gives those warnings/recommendations as appropriate.
    Brilliant.

    When trying to help teach VB students in my school, I often try to explain to the teachers and the students that you shouldn't use the legacy functions, but no one ever believes me due to the fact that the book (vb .net book) only uses the legacy functions, and due to the fact that books are always right, why listen to logic? (I hate our ill-written school books)

    However, the idea of warnings displayed when the user uses legacy functions is great!

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