Page 18 of 24 FirstFirst ... 815161718192021 ... LastLast
Results 681 to 720 of 939

Thread: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

  1. #681
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by PlausiblyDamp View Post
    Just saw this crop up in the VB6 side of things... https://www.vbforums.com/showthread....Array-is-Empty is that honestly how you check if an array is empty in VB6?

    Code:
    Function IsArrayInitialized(arr As Variant) As Boolean
        If Not IsArray(arr) Then Err.Raise 13
        On Error Resume Next
        IsArrayInitialized = (LBound(arr) <= UBound(arr))
    End Function
    https://www.vbforums.com/showthread....uot-empty-quot
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  2. #682
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Egad.

    Decided to get a Windows 10 tablet that has set unused for 3 years charged and updated. Taking forever, vast amount of .Nut Frumbleworks updates and security bug fixes that dwarf everything else in downloaded bits and elapsed time.

    The .Nut Tax must end. Make the curse optional again.

  3. #683
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Niya View Post
    Yep, that is actually real. That is the kind of trash that people actually believe is better than .Net.

    You've never used VB6, have you PD? If the answer is no, then let me tell you, there's way worse.
    I used to use VB6 a lot, in fact first used VB3 and then also suffered VB4 before using 5 and then 6. I have barely touched VB6 in about 20 years and probably not used it at all in the past 15 years; I think I have forgotten just how many odd quirks and issues I used to take for granted, simply because VB6 was better than the alternatives at the time.

    It has got me wondering though if I ever did spot the weird quirks around detecting an empty array or if I just left odd bugs in my code... Doubt any of my old code is still in production so I am not losing any sleep over it

  4. #684
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by dilettante View Post
    .Nut Frumbleworks
    I really like that. Glad to see the pills are working.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  5. #685
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Really? I've always been annoyed by people who try to demonize their enemies by making up stupid variations on their names. It's like all the Apple fans with Windoze, and their variations on that. It appeared to be done to try to protect themselves from the fact that they were losing the fight. It was a way of giving up by trivializing the reasons they were losing.
    My usual boring signature: Nothing

  6. #686
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Well, I only laughed. Sorry to hurt your feelings...
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  7. #687

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by yereverluvinuncleber View Post
    Code:
    Function IsArrayInitialized(arr As Variant) As Boolean
        If Not IsArray(arr) Then Err.Raise 13
        On Error Resume Next
        IsArrayInitialized = (LBound(arr) <= UBound(arr))
    End Function
    https://www.vbforums.com/showthread....uot-empty-quot
    The point he is making is that this kind of thing is actually insane. Using an error trap or a bunch of Win32 API hacks to check for an empty array is just nuts. In .Net arrayVar.Length or arrayVar Is Nothing will suffice.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  8. #688

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by dilettante View Post
    Egad.

    Decided to get a Windows 10 tablet that has set unused for 3 years charged and updated. Taking forever, vast amount of .Nut Frumbleworks updates and security bug fixes that dwarf everything else in downloaded bits and elapsed time.

    The .Nut Tax must end. Make the curse optional again.
    Here you go. No updates required.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  9. #689

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by PlausiblyDamp View Post
    I think I have forgotten just how many odd quirks and issues I used to take for granted, simply because VB6 was better than the alternatives at the time.
    Yea, for all it's quirks it really was far better than anything else out there. They were easy to live with in those times. Not today though. I'd rather eat nails than go back to writing VB6 code in for any lengthy period of time. Some VB6 projects can be fun but that fun quickly wears out. After using VB.Net for so many years, using VB6 feels like skating up hill. It's grueling.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  10. #690
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Niya View Post
    The point he is making is that this kind of thing is actually insane.
    I think that describing it as insanity is a slight overreaction, madness it is not. Perhaps that is a UK/US English language thing (where you lot tend to overreact). I'd use the word surprising or incorrect or perhaps you mean ridiculous? I suggest you be specific if you want to criticise accurately.

    Testing for an error is something I am fairly sure I have done quite a lot, even in your VB^. I certainly remember having to do something similar in VB^.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  11. #691
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by yereverluvinuncleber View Post
    I think that describing it as insanity is a slight overreaction, madness it is not. Perhaps that is a UK/US English language thing (where you lot tend to overreact). I'd use the word surprising or incorrect or perhaps you mean ridiculous? I suggest you be specific if you want to criticise accurately.

    Testing for an error is something I am fairly sure I have done quite a lot, even in your VB^. I certainly remember having to do something similar in VB^.
    Certainly surprising and potentially ridiculous Testing for errors is certainly something you do in code, I just wouldn't have expected to do something like that for something as basic as checking if an array is empty or not!

  12. #692
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Just because you saw some newb code it doesn't prove anything.

    Using a type library you can just do something like:

    Code:
        Dim L() As Long
    
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 0 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
        ReDim L(1)
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 0 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
        Erase L
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 0 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
    There is no run time baggage involved. Unlike using the gigantic malware attack surface of the foreign .Net infrastructure we're all forced to pay the tax for these days.
    Last edited by dilettante; Oct 18th, 2021 at 02:57 PM.

  13. #693
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by dilettante View Post
    Just because you saw some newb code it doesn't prove anything.

    Using a type library you can just do something like:

    Code:
        Dim L() As Long
    
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 1 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
        ReDim L(1)
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 1 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
        Erase L
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 1 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
    I would have still expected a language that has arrays to have a built in way of detecting if they are empty or not, just seems such a basic bit of functionality to be missing.

    Quote Originally Posted by dilettante View Post
    There is no run time baggage involved. Unlike using the gigantic malware attack surface of the foreign .Net infrastructure we're all forced to pay the tax for these days.
    Apart from the VB6 runtime and supporting Dlls that is, which admittedly ships with windows - as does most of the versions of .Net framework.

  14. #694
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by PlausiblyDamp View Post
    I would have still expected a language that has arrays to have a built in way of detecting if they are empty or not, just seems such a basic bit of functionality to be missing.



    Apart from the VB6 runtime and supporting Dlls that is, which admittedly ships with windows - as does most of the versions of .Net framework.
    No language has that functionality built-in ... not even VB.NET or C# ... it's built in to the libraries for you, that's the difference. So creating a VB6 library that does the checking really isn't all that different. It's just a matter of who puts it together. VB6 is a bag of rice that has to be washed and cleaned before being cooked for 20 minues... .NET is a bag of par-cook Uncle Ben's rice that you can toss in the microwave for 90 seconds ... Which is better? It depends. I get better sticky rice with the hand version. I get faster results with the Uncle Ben's version...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  15. #695
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Horses for courses, or rice, or something.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  16. #696
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Is .NET the new bronze?

    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  17. #697

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by dilettante View Post
    Just because you saw some newb code it doesn't prove anything.

    Using a type library you can just do something like:

    Code:
        Dim L() As Long
    
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 1 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
        ReDim L(1)
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 1 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
        Erase L
        If MemLong(ArrPtr(L)) = 0 Then
            MsgBox "Unallocated"
        ElseIf UBound(L) - LBound(L) < 1 Then
            MsgBox "Empty"
        Else
            MsgBox "Non-empty"
        End If
    There is no run time baggage involved. Unlike using the gigantic malware attack surface of the foreign .Net infrastructure we're all forced to pay the tax for these days.
    Ain't nobody got time for all that insanity:-
    Code:
            Dim l As Long()
    
            If l Is Nothing OrElse l.Length = 0 Then
                MessageBox.Show("Empty or doesn't exist")
            Else
                MessageBox.Show("non-Empty")
            End If
    No need to waste a bunch of time creating type libraries or hoping it exists in the bowels of VBForums. No need for error traps or any of that garbage. We just get it done and move on. VB6 forces people to waste too much time on nonsense like that.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  18. #698

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by techgnome View Post
    No language has that functionality built-in ... not even VB.NET or C# ... it's built in to the libraries for you, that's the difference. So creating a VB6 library that does the checking really isn't all that different.
    That's kind of the point. We shouldn't have to write our own libraries for it. That is just wasting time that could have been spent elsewhere.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  19. #699
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by techgnome View Post
    VB6 is a bag of rice that has to be washed and cleaned before being cooked for 20 minues... .NET is a bag of par-cook Uncle Ben's rice that you can toss in the microwave for 90 seconds ... Which is better? It depends. I get better sticky rice with the hand version. I get faster results with the Uncle Ben's version...

    -tg
    The funny thing is, I could go on a bit of time about THAT distinction. Essentially, you want that par-cook for the desert, where you won't have water, and otherwise you want the dry, since it's lighter. I've done both. A packrat stole my spoon, too.
    My usual boring signature: Nothing

  20. #700

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by yereverluvinuncleber View Post
    I think that describing it as insanity is a slight overreaction
    Importing a type library or using error trap just to detect if an array is empty is monumentally insane.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  21. #701
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Niya View Post
    That's kind of the point. We shouldn't have to write our own libraries for it. That is just wasting time that could have been spent elsewhere.
    Then don't.... use someone else's library ... that's what you're doing in .NET... you shifted the burden of proof (so to speak) from yourself - where if you were dealing with this, you'd take that, wrap it in to your own library and use that everywhere you want - to someone else - where someone wrote the library for you and all you're doing is referencing it.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  22. #702
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Do you know, I have been thinking about it and perhaps there should be another entirely different thread which explains why "VB6 is just good enough to be used today...".

    I do not argue that VB6 is generally better than VB^ as the later product ought to be better just by dint of years of development. However I do think VB6 is more appropriate in at least more than one respect, possibly many - but there is no need to go into that list again.

    My point here is that as VB6 'can' do more or less anything with a little cajoling (we are used to that level of work) and the VB6 IDE is a nice enough place to work (certainly better than some), it is just good enough to warrant continuing. It is good 'enough'.

    The nice thing is that choice exists and as a result we can do whatever we want. In the context of the good ol' USA it seems quite a Republican thing to do, allow freedom to use any good ol' tool we want whether or not it is sensible to do so. I understand it is quite a 'Democrat'-ic thing to cajole others into doing things they don't want?

    Being English, using an anchronistic tool to do anything seems to me to be a noble cause in itself, worthy of praise.

    Ultimately, we should be able to use any tool we choose if it has benefits for us. In this respect VB6 is good enough...
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  23. #703
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by yereverluvinuncleber View Post
    Ultimately, we should be able to use any tool we choose if it has benefits for us. In this respect VB6 is good enough...
    I have no problem with this statement. I do have a problem when on the other side of your (the proverbial "your") mouth the other tools are chided as being perceived as too bloated, too difficult to learn, etc.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  24. #704
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    I have a problem with MOST of it.


    Quote Originally Posted by yereverluvinuncleber View Post
    Do you know, I have been thinking about it and perhaps there should be another entirely different thread which explains why "VB6 is just good enough to be used today...".
    Oh gawwwwd!! Do we really need another?
    The nice thing is that choice exists and as a result we can do whatever we want. In the context of the good ol' USA it seems quite a Republican thing to do, allow freedom to use any good ol' tool we want whether or not it is sensible to do so. I understand it is quite a 'Democrat'-ic thing to cajole others into doing things they don't want?
    Yeah, as if these language wars aren't contentious enough, let's bring politics into it.
    Being English, using an anchronistic tool to do anything seems to me to be a noble cause in itself, worthy of praise.
    Well, you DO have a point there. Wait long enough, and the US will probably have VB6 fairs, where people wear funny clothes and pretend they used the language back in the day.

    Ultimately, we should be able to use any tool we choose if it has benefits for us. In this respect VB6 is good enough...
    Yep, and to declare it loudly and repeatedly. It never seems to be enough to just do something.
    My usual boring signature: Nothing

  25. #705

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by yereverluvinuncleber View Post
    "VB6 is just good enough to be used today...".
    You guys keep missing the point. VB6 is more than adequate to be used today. VB6 is an extremely powerful development environment. We all know that.

    However, to claim that it is overall better to develop applications in it than a .Net based environment with technologies like the Visual Studio 2019, .Net Framework/.Net 5/.Net 6 etc, C#, VB.Net, WinForms, WPF, ASP.Net etc is suspect. Then when you guys bring up reasons why you think VB6 is better than these technologies, that's when it moves from suspect to just plain ridiculous.

    Like I said earlier somewhere in this thread, the only advantage I think VB6 has over it's modern successors is that it produces more knowledgeable and determined programmers because of how primitive it is. VB6 is basically Win32 programming so to be adept at VB6 means you also have to be very adept at Win32 programming.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  26. #706
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Niya View Post
    Like I said earlier somewhere in this thread, the only advantage I think VB6 has over it's modern successors is that it produces more knowledgeable and determined programmers because of how primitive it is. VB6 is basically Win32 programming so to be adept at VB6 means you also have to be very adept at Win32 programming.
    I'd agree that's definitely ONE advantage of - many?
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  27. #707

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Yet another example of how unintuitive VB6 is compared to .Net.

    In particular pay attention to what Elroy says here:-
    You can add controls from scratch during runtime, but it's a bit tricky.
    and here:-
    And secondly, it's often tricky to figure out how to get the reference name correct, but the error system will often help you with this when you've got it wrong. Also, you can look up how to correctly declare them in the Object Browser.
    and here:-
    First, when doing this, it's typically advisable to turn off the project's "Remove information about unused ActiveX Controls" as that will often remove the necessary reference.
    and finally this:-
    Also, adding control arrays is even trickier, and I haven't addressed that.
    All of this song and dance. We don't even have to think about all of all this nonsense in .Net:-
    Code:
            For i = 0 To 9
                Dim btn As Button = New Button With {.Text = $"Button {i.ToString}"}
    
                btn.Top = i * 25
                btn.Height = 25
    
                AddHandler btn.Click, Sub(b As Button, e1 As EventArgs) Debug.WriteLine(b.Text)
    
                Me.Controls.Add(btn)
            Next
    Nothing tricky about that. You handle it exactly as you would handle any object.



    BTW, its fully supported by the intellisense. In VB6, Me.Controls.Add doesn't give you anything. If you've never used it before, you're going to have to divert time away from actually writing your program to go find out what the parameters for Add are and how to use them.
    Last edited by Niya; Oct 22nd, 2021 at 01:16 PM.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  28. #708
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    @Niya - a little bit of code cleanup:
    Code:
    For i = 0 To 9
        Dim btn = New Button With {
            .Height = 25,
            .Text = $"Button {i.ToString}",
            .Top = Top = i * 25
        }
    
        AddHandler btn.Click, Sub(b As Button, e1 As EventArgs)
                                  Debug.WriteLine(b.Text)
                              End Sub
        Controls.Add(btn)
    Next
    My notes:
    1. You were inferring the data type in the For/Next loop, but not the control declaration. For consistency I changed it to infer the data type during declaration.
    2. You were using the With statement to set the text, but then you were setting Top and Height outside of the With. I moved it so that all the properties are being set in the With block
    3. You had referenced Me prior to accessing the Controls, which is unnecessary


    Edit - Also for readability (and likely needed for functionality assuming you want to do more than Debug.WriteLine) I've changed the event handler of the AddHandler to be a multi-line anonymous method rather than in inline one.
    Last edited by dday9; Oct 22nd, 2021 at 01:42 PM.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  29. #709
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Niya View Post
    All of this song and dance. We don't even have to think about all of all this nonsense in .Net:-
    Code:
            For i = 0 To 9
                Dim btn As Button = New Button With {.Text = $"Button {i.ToString}"}
    
                btn.Top = i * 25
                btn.Height = 25
    
                AddHandler btn.Click, Sub(b As Button, e1 As EventArgs) Debug.WriteLine(b.Text)
    
                Me.Controls.Add(btn)
            Next
    As usual, typical Newbie-thinking - because...

    Your customer now makes his first change-requests:
    - the first 5 buttons should be 1:n Option-Buttons (rendered in CommandBtton-style with a BorderRadius of 12.5)
    - all Click-Events should report the current Control-Index in the Controls-List in the Form-Caption
    - a DblClick-Event should remove the Button in question from the Controls-List
    - oh... and when hovering over a Button with the Mouse, the Caption should be rendered in Bold

    Now I'd like to see, what mess you'd make out of this, when such real-world-demands come in...

    Olaf

  30. #710
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Uhhh, I don't see any of those as being difficult, with the possible exception of the border radius being such a specific value (without units, so you could technically language lawyer that into anything).

    I'd certainly be asking that user what they were thinking, since those are some strange requests to pull out of thin air, but there isn't all that much difficulty to any of those requests.
    My usual boring signature: Nothing

  31. #711
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    I was thinking the same thing. It’s more or less be the same approach.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  32. #712
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Shaggy Hiker View Post
    Uhhh, I don't see any of those as being difficult,
    with the possible exception of the border radius being such a specific value
    (without units, so you could technically language lawyer that into anything).
    Let's assume the same Units, as Niya was assuming when specifying the Height of the Buttons (25).

    Quote Originally Posted by Shaggy Hiker View Post
    I'd certainly be asking that user what they were thinking, since those are some strange requests ...
    Hah, I've seen worse... - but the customer is always king, so... can you deliver or not?

    Quote Originally Posted by Shaggy Hiker View Post
    ...but there isn't all that much difficulty to any of those requests.
    Yep, in VB6 there'd be no problem to solve this with a few additional lines -
    but it seems in .NET there is.

    Come on guys, don't bail out on me again and show me some code...
    (you have generics, LINQ, async/await, etc... the problem should only take a minute of your time).

    Olaf

  33. #713

    Thread Starter
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Schmidt View Post
    As usual, typical Newbie-thinking - because...

    Your customer now makes his first change-requests:
    - the first 5 buttons should be 1:n Option-Buttons (rendered in CommandBtton-style with a BorderRadius of 12.5)
    - all Click-Events should report the current Control-Index in the Controls-List in the Form-Caption
    - a DblClick-Event should remove the Button in question from the Controls-List
    - oh... and when hovering over a Button with the Mouse, the Caption should be rendered in Bold

    Now I'd like to see, what mess you'd make out of this, when such real-world-demands come in...

    Olaf
    I'd accept the challenge except I need to know what this means:-
    rendered in CommandBtton-style
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  34. #714
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    CommandButton-style in the meaning of: "CommandButton-face"
    (Option- and CheckBoxes in VB6 can be set to this style).

    And to separate the first 5 Buttons of the 10 (which shall act like an Option-Button-Group),
    from the rest of the Buttons, I'd like you to apply an Extra-BorderRadius to them ...
    (so that their outline is kinda like an old Mac-Button).



    In the above ScreenShot:
    - the (Option-)Button 2 is "selected"
    - the normal Button 5 was already removed from the List (via DblClick-Event)
    - and Button 8 was "just clicked" (and is currently "hovered", so its Caption is Bold)
    - Button 8 has also "just reported" its Control-Array-index into the Form-Caption

    HTH

    Olaf

  35. #715
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Yeah, option buttons can be set that way in .NET, too, and probably checkboxes, though I have never looked at that.

    As to the customer being king, I realize that I am in an unusual situation where I'm not just the coder but at least as much a domain expert as anybody I am writing for, but the customer is not king to me. If they ask me for something stupid, or fail to explain why, then I just say no.

    I'm saying no in this case, too. I'm going to assume that your are smart, since you do appear that way, and therefore the very peculiarity of the list of challenges suggests that there is a reason for the elements on the list. Essentially, you picked a set of problems that you feel are easier in VB6 than in .NET, and are hoping that we'll jump through your hoops for your entertainment. Simply put, no.

    If you want to show how easy it is to do in VB6, go right ahead. You probably should anyways. After all, you are essentially setting up a game board to your liking, and asking us to play a game where the rules are whatever you decide they are. I think I know what you would show, and it would be terribly disingenuous, but until you actually show it, I can't be certain.
    My usual boring signature: Nothing

  36. #716
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Why no? I thought this is super simple in WPF, as easy as this

    Code:
    <Button>
        <Button.Resources>
            <Style TargetType="Border">
                <Setter Property="CornerRadius" Value="5"/>
            </Style>
        </Button.Resources>
    </Button>
    cheers,
    </wqw>

  37. #717
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    I've stayed away from WPF. It's a different animal, and an interesting one. I was going to go that direction several years back, but was told that I couldn't for the project I was working on. Since then, I've kind of stuck with that. It's a powerful approach, but, of course, everything you can do with that you can do without that with a bit more work. It seems to be a distinct minority approach...

    ...well, I guess the reason would require too much of a backstory, so I'll leave it there. Bottom line: I considered it, and decided against it for reasons that may be good or may be bad, but what's done is done.
    My usual boring signature: Nothing

  38. #718
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by Shaggy Hiker View Post
    Essentially, you picked a set of problems that you feel are easier in VB6 than in .NET...
    Glad you noticed...

    So, there's apparently "stuff in the libraries" each camp has access to,
    which encourages to "formulate and solve" things differently ...
    (sometimes more efficient in .NET, sometimes more efficient in VB6).

    That's the reason I always ask you .NETers for "more realistic, more complete" examples -
    not just these over simplifying and pointless "Micro-snippets" Niya comes up with any other week.

    As soon as the problem to solve gets more realistic, more "well rounded" -
    you will not see much of a difference in efficiency (only a difference in mem-consumption and performance).

    Olaf

  39. #719
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    You feel that they’re easier in VB6, but Niya’s approach you’d only need to modify the snippet slightly and the overall concept doesn’t change even for those arbitrary requirements.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  40. #720
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Why is VB.Net/C#/XAML + VS2019 is better than VB6? Here's why.....

    Quote Originally Posted by dday9 View Post
    ...you’d only need to modify the snippet slightly and the overall concept doesn’t change even for those arbitrary requirements.
    Slightly you say, but where is the code?

    Olaf

Page 18 of 24 FirstFirst ... 815161718192021 ... LastLast

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