Page 1 of 2 12 LastLast
Results 1 to 40 of 43

Thread: VB6's advantage over visual C++

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Resolved VB6's advantage over visual C++

    Hello

    having used VB6 for a few months, i see that it is very powerful to develop desktop applications. I was wondering what are its advantages over Visual C++?

    does Visual C++ offer a similar fast development environment that VB6 offers, i remmeber playing with Visual C++ sometime back but i was so bogged down by it.

    i guess what java, it is horses for courses,
    java can be translated into platform independent code which can run on different OS's, correct(or is that a noobie statement?)
    Last edited by vb_student; Sep 16th, 2005 at 06:48 PM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: VB6's advantage over visual C++

    RAD - Rapid Application Development.

    It's what's sold millions of copies. C++ has speed advantages while it's runing, but VB6 is all about RAD. Ease of use.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: VB6's advantage over visual C++

    VC++ is a ***** to write fast GUI apps in unless you really know your Win32. Of course most people use the MFC wrappers which makes it a bit easier but slows it down a bit, but then you start leaning toward the VB principle of ease of use over performance, so you negate the purpose of using C++ in the first place.

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: VB6's advantage over visual C++

    Using a library like QT to make the GUI for C++ apps is not that much slower then VB. It is drag and drop...


    - ØØ -

  5. #5
    Hyperactive Member
    Join Date
    Apr 2001
    Location
    N42 29.340 W71 53.215
    Posts
    422

    Re: VB6's advantage over visual C++

    If you're not sure about VB6 vs Visual C++, just dive into VB.NET and you'll get the best/worst? of both worlds (IMHO)

    Remember, "C combines the power of assembly language with the flexibility of assembly language" (not to mention the elegance)

    It's really more a matter of personal preference in most cases,
    and those of us with discerning, refined tastes choose Jiff ... I mean VB.
    "The wise man doesn't know all the answers, but he knows where to find them."
    VBForums is one place, but for the really important stuff ... here's a clue 1Tim3:15

  6. #6
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    VC++ gives you more control over your app than VB does, and has major speed advantages. It even supports inline assembly.

    Forms in VB use the MFC, which is why it is slow. But using Win32 is much faster than MFC, and yes, you can do Win32 in VB by not having any forms in your project and using nothing but modules, and create a Win32 window using API calls. Here is an example:

    http://www.vbforums.com/attachment.p...chmentid=35001

    It's more code but allows you to work with Win32 like C++. If you want to work with C++ and assembly in VB as well, there is a VB addin out there called ThunderVB. If you Google it, it should be available for you to download. The assembly even has a listview like the regular VB objects have to make it easier for you to code in assembly.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    thanks for all the replies, another quality information discussion
    i have got the following queries
    so who uses VB and who uses C++

    noteme, what is QT?

    davebo, you mean VB.net combines C++ and VB?

    davebo, i did not understand your statement
    Remember, "C combines the power of assembly language with the flexibility of assembly language" (not to mention the elegance)
    what is inline assembly, i have done assembly before

    what kind of control advantages does VC++ give eover VB?

    so by using thunderVB, i can write VB stuff which interacts with processors? i guess thunderVB would let me communicate with RISC as well as CISC processors
    Last edited by vb_student; Sep 11th, 2005 at 12:52 PM.

  8. #8
    Hyperactive Member capsulecorpjx's Avatar
    Join Date
    May 2005
    Location
    Renton, WA
    Posts
    288

    Re: VB6's advantage over visual C++

    Unless your app is CPU intensive, or you need extreme customization, choose VB 6.
    "I like to run on treadmills, because at least I know I'm getting nowhere."
    - Me

  9. #9
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    ThunderVB is available to download from Planet Source Code over in the VB section. It won the coding contest of the month:

    http://www.planet-source-code.com/vb...62038&lngWId=1

    After you add the AddIn, ThunderVB, you can do the assembly like so:



    What Inlining means (which only C++ and C# support) is that instead of making the actual call to the function, it just executes the code within the function. This makes a dramatic speed increase to the execution of your functions/subs, but only if there are more than a few lines of code, otherwise it will be slower than calling the function. And you do it like so:

    Code:
    inline int Test(){
    
         //code goes here
    
         return 1;
    
    }
    Now to be able to inline in languages that don't support the inline keyword, all you do is manually type in the code in the area where you wanted the function to be called. It eliminates code readability, but it executes faster than calling the function/sub, but only if there are more than a few lines of code. Now you know what inlining is, as to inline assembly.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    thanks for the reply jacob

    you mean that inlining wiull actually embed the assembly within the function. hence there will be no jump to an address location elsewhere and then a return to the original address location(i geuss this would mean involvement of pushing and poping stuff of the stack)
    i think c also has inlining, am i correct?

  11. #11
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    Yep you are. I'm not sure what ThunderVB does with their assembly, but they claim it to be inline.

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    thanks for the replies guys

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    hey the assembler seems to be x86, can the thunderbird handle other processors(RISC processors)

    hey why do we use assembly in the middle of a VB program, is it for performance?

  14. #14
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    Not sure what instructions it supports other than x86. But I believe RISC also uses x86. Assembly is still used for speed purposes. It executes faster than normal high level languages at lightning speeds, depending on how it was coded. SSE/SSE2 instructions execute even faster than x86 instructions.

  15. #15

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    thanks for the reply
    what is SSE/SSE2?

  16. #16
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    SSE/SSE2/SSE3 instructions are all a part of SIMD, which stand for Single Instruction Multiple Data. Typically you would be working with SISD (Single Instruction Single Data) which means every line of assembly (or high level languages for that matter) only does one thing per cycle. What SIMD allows you to do in assembly is work with multiple data per cycle. So you can see what I mean by speed.

    The Pentium 3 is the first processor to support SSE. Pentium 4 and the AMD Athlon supports SSE2 as well as SSE. And the 64 bit processors such as the AMD Athlon 64 support SSE3, SSE2, and SSE. Previously before the Pentium 3, the Pentium 2 supported MMX, and in the later processors still do to this day, which is also faster than regular x86 instructions but not as fast as the SSE based instructions. Even the PlayStation 2, XBox, and GameCube use SSE. See these for details:

    http://msdn.microsoft.com/library/de...extensions.asp
    http://msdn.microsoft.com/library/de...technology.asp

  17. #17

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    thanks for the lowdown on the SSE family
    i guess thunderbird can handle SSE, correct?

  18. #18
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    I dunno. I have VB5, not VB6, and it's not supported for my version of VB unfortunately.

  19. #19
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: VB6's advantage over visual C++

    Hi There,
    In ThunderVB, the assembly is inline in the sense that you can do this:

    Public Sub ASMBubbleSort(ByRef alNumbers() As Long, ByVal Lb As Long, ByVal Ub As Long)
    '#asm'.pureasm
    '#asm' push esi
    '#asm' push edi
    '#asm'
    '#asm' mov eax, [esp+12]
    '#asm' mov edx, [esp+16]
    '#asm' mov eax, [eax]
    '#asm' mov ecx, [esp+20]
    '#asm' mov eax, [eax+12]
    '#asm'
    '#asm' sub ecx, edx
    '#asm' add eax, edx
    '#asm' add eax, edx
    '#asm' add eax, edx
    '#asm' add eax, edx
    '#asm'
    '#asm'
    '#asm' LoopI:
    '#asm' mov edx, 1
    '#asm' LoopJ:
    '#asm' mov esi, [eax+edx*4-4]
    '#asm' mov edi, [eax+edx*4]
    '#asm' cmp esi, edi
    '#asm' jl @F
    '#asm' mov [eax+edx*4-4], edi
    '#asm' mov [eax+edx*4], esi
    '#asm' @@:
    '#asm'
    '#asm' add edx, 1
    '#asm' cmp edx, ecx
    '#asm' jle LoopJ
    '#asm' sub ecx, 1
    '#asm'
    '#asm' jns LoopI
    '#asm'
    '#asm' pop edi
    '#asm' pop esi
    '#asm' ret 12
    End Sub

    Btw. .pureasm is ThunderVB specific - it deletes all asm generated by vb within the function.

    You can also insert in between vb code but is very hard to do as you need to examine the vb asm listing to know what you are doing - and it screws up jmp(s) generated by vb because it changes the size of generated output.
    So generally, you don't do this.

    I find the best way to use the inline asm is to add it into a function like the one i have shown above.

  20. #20

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    how can i examine the VB asm listing?

  21. #21
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: VB6's advantage over visual C++

    You can only do that for VB.NET using Visual Studio itself.

    However, if you are good at parsing exe files and manage to only obtain the machine code (excluding the DOS stub, DOS header, and those other things Windows is looking for to run the exe), and successfully convert it to assembly, well that I would like to see.

  22. #22
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: VB6's advantage over visual C++

    Gad, that would be HELL. None of the variables would have names. I realize that names are just a convenience in ASM, but what a convenience they are! Trying to figure out ASM when all you have are pure memory addresses for variables would be annoying almost beyond belief.
    My usual boring signature: Nothing

  23. #23
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: VB6's advantage over visual C++

    It would be easy to get around that problem if ThunderVB supports text macros, for example:

    Code:
    '#asm' myVariableA TEXTEQU <[eax+edx*4-4]>
    '#asm' myVariableB TEXTEQU <[eax+edx*4]>
    
    ...
    
    '#asm' LoopI:
    '#asm' mov edx, 1
    '#asm' LoopJ:
    '#asm' mov esi, myVariableA   
    '#asm' mov edi, myVariableB 
    '#asm' cmp esi, edi
    '#asm' jl @F
    '#asm' mov myVariableA, edi
    '#asm' mov myVariableB , esi
    '#asm' @@:
    
    ...
    Last edited by wossname; Oct 5th, 2005 at 07:37 AM.
    I don't live here any more.

  24. #24
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: VB6's advantage over visual C++

    PS:

    C# doesn't support inline ASM. Or inline anything for that matter, AFAICT.
    I don't live here any more.

  25. #25
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: VB6's advantage over visual C++

    And with good reason, there's not a lot of joy to come from inlining a class method

    Inline functions and/or ASM are compiler operations however. If you were building a C# compiler you could designate a few compiler extension keywords that allowed inline IL (there is some patch that allows for this I think), and possibly inlining of local private methods.

  26. #26
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: VB6's advantage over visual C++

    Does ASM inlining even make sense with the JIT model that MS is pushing? I always assumed that .NET was MS's answer to Java. A suite of programming languages that would be able to run platform-independent. ASM could hardly be MORE platform dependent, so there would be no good way to handle inline ASM through the JIT. If your .NET written, managed-code program, used ASM, it would no longer be platform independent, and would defeat the purpose of .NET, assuming I understand what MS was intending correctly.
    My usual boring signature: Nothing

  27. #27
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: VB6's advantage over visual C++

    The compiler in Visual Studio is spewing out ASM anyway...so it is not usefull for other platforms at all. It is getting cleaner for every new generation though.


    An C# MVP has written a small app for you to inline IL in C#. Plenderj told me when he was helping us with D# before someone brutaly banned him....



    - ØØ -

  28. #28
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: VB6's advantage over visual C++

    I thought the compiler in VS was only spewing (can you believe I had to check NoteMe's post for the correct spelling of that word ) out ASM for unmanaged C++, and IL for VB.NET and C#. If that isn't the case, then I guess MS has decided not to go multi-platform.
    My usual boring signature: Nothing

  29. #29
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: VB6's advantage over visual C++

    No, it is also adding ASM to the compiled code. At least in 01, and 03. Havn't heard anything about 05 yet. But I think they are starting to improve.

    This will just be a guess from my side, but I don't think that MS would have thought .NET would become that popular. I guess they gave the C# standard and so on to ECMA to make it look like they didn't want it all for them self, so it would be more popular. ANd boy it did. And now suddenly they have competitors like Mono and that other Dot thingy that actualy compiles to true IL. So if you compile something in Linux, you can use it in Windows, but if you compile something using VS then you can't use it in Linux, but the funny thing is that you can also get Mono for Windows, so compiling it with mono in windows then you can also use it in Linux...so hmm...wouldn't that make the mono compiler better then the VS one..hmmm...so that is why I think they are kind of back paddeling now. Have to keep up with the competitors.


    - ØØ -

  30. #30
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: VB6's advantage over visual C++

    Well to be pedantic, Visual Studio pukes out IL which IS platform independant. However each platform must implement its own JIT compiler (which runs in the background as part of the framework runtimes) which compiles this IL into that platform's machine code.

  31. #31
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: VB6's advantage over visual C++

    Not sure what pedantic means...but in theory you are right...in practice it hurts to say it, but it isn't...at least not today...

  32. #32
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: VB6's advantage over visual C++

    Quote Originally Posted by vb_student
    how can i examine the VB asm listing?
    You can examine vb asm listing with thundervb
    As soon as you compile it will make an error in the asm it will bring up a dialog with the asm listing for that module with the error.
    That is the quickest way.

    Otherwise you check - 'modify cmd line'
    I'm not sure what you do from there but ask on thundervb forums.
    http://thundervb.profitux.cz/

  33. #33
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: VB6's advantage over visual C++

    Quote Originally Posted by wossname
    It would be easy to get around that problem if ThunderVB supports text macros, for example:

    Code:
    '#asm' myVariableA TEXTEQU <[eax+edx*4-4]>
    '#asm' myVariableB TEXTEQU <[eax+edx*4]>
    
    ...
    
    '#asm' LoopI:
    '#asm' mov edx, 1
    '#asm' LoopJ:
    '#asm' mov esi, myVariableA   
    '#asm' mov edi, myVariableB 
    '#asm' cmp esi, edi
    '#asm' jl @F
    '#asm' mov myVariableA, edi
    '#asm' mov myVariableB , esi
    '#asm' @@:
    
    ...

    Yes ThunderVB supports all macros that are supported from masm because it uses masm

  34. #34
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: VB6's advantage over visual C++

    Quote Originally Posted by Shaggy Hiker
    Does ASM inlining even make sense with the JIT model that MS is pushing? I always assumed that .NET was MS's answer to Java. A suite of programming languages that would be able to run platform-independent. ASM could hardly be MORE platform dependent, so there would be no good way to handle inline ASM through the JIT. If your .NET written, managed-code program, used ASM, it would no longer be platform independent, and would defeat the purpose of .NET, assuming I understand what MS was intending correctly.
    Penagate said inline IL (so I assume 'ASM' meant 'ILASM')
    Inline IL would be crossplatform because c# and vb.net and managed c++ are all compiled to ilasm anyway. And ilasm is unlikely to change because it needs to be backwards-compatible.

  35. #35

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    Does ASM inlining even make sense with the JIT model that MS is pushing? I always assumed that .NET was MS's answer to Java. A suite of programming languages that would be able to run platform-independent. ASM could hardly be MORE platform dependent, so there would be no good way to handle inline ASM through the JIT. If your .NET written, managed-code program, used ASM, it would no longer be platform independent, and would defeat the purpose of .NET, assuming I understand what MS was intending correctly.
    i was planning to learn java, should i forget about java and go ahead with learning .net?

  36. #36
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: VB6's advantage over visual C++

    Personally i recommend .NET.
    Reason: Microsoft supports it.
    Java.....
    If you are planning to write cross-platform applications now then learn Java.
    .NET is going to be cross-platform but now only supports some mobile devices and Windows-based PCs. Mono supports .NET for Linux but its not 100% compatible with the windows version of .NET and vice versa.
    In the long run .NET is the winner in my opinion though - because you could almost say .NET learnt for java's mistakes.

    I hope Im not starting a flame with java programmers here(hopefully no java ppl look at his forum )

  37. #37
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: VB6's advantage over visual C++

    Yes, I said inline IL for that reason, ASM is platform-specific. Inline ASM in .NET, by that token, makes no sense.

    C# is rather similiar to Java, if you want you could learn both. The more languages you know, the more versatile and generally capable programmer you are

  38. #38
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: VB6's advantage over visual C++

    Yes both would be better.
    Though I actually would rather learn c, c++ first though then again back to platform dependence. However you could compile and distribute separate binaries for different oses or use wxWidgets (or such cross-platform gui)
    I prefer this to java/.net.
    Last edited by Raedwulf; Oct 8th, 2005 at 04:21 AM.

  39. #39

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2005
    Posts
    1,069

    Re: VB6's advantage over visual C++

    is .net MS's attempt at making a "cross platform" development environment, you mean to say later version of .net would be true cross platform and would give java a run for its money?

    when we talk about .net competing with java, are we talking about just c# or any one of them alone
    in that case why learn vb.net?

    what is mono?

    i have programmed in c and understand the fundamentals+syntax of c++. can you guys point me to resources which talk about the fundamentals of platform dependence

  40. #40
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: VB6's advantage over visual C++

    VB.NET is Microsoft's way of getting the large VB6 community to move to .NET, while C# is their primary .NET language and their end goal for developers.

    I think you mean the fundamentals of platform independence, well basically that is any programming that doesn't involve platform dependence, such as reliance on APIs. A framework such as .NET or Java is ideal for platform independent programming because it provides an extra layer of abstraction between the core operating system APIs and the programming environment. The same .NET IL will be compiled to use the specific ASM and APIs for the platform it is run on.

Page 1 of 2 12 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