Fog Creek Software
Discussion Board

VB and VC++

I've seen posts here before (and a few very recently in relation to .NET) saying that you only lose a bit of speed using VB, and that you'll also make less mistakes when compared to coding in C++ (i'm guessing they meant memory leaks, null pointers, ...)

I'm just curious - does this only apply to business-style applications, or to graphics ones as well (i.e. Photoshop, Bryce, etc.) Can you really do fast Windows graphic/graphic manipulationg programming in VB? Even beyond that, would DirectX coded in VB just as fast as that coded in C/C++?

Monday, March 25, 2002

VB6 definitely pays a speed penalty compared to VC++6, but the reality is that in _most_ cases it's just not that important. 99% of what most programs do is wait for user input.

However, in a few circumstances, you'll find that dropping into C++ may be necessary for performance. Your example for graphics is good. VB is perfectly capable of doing the UI, but it might make performance sense to move the computational work to C++.

Of course, the rules completely change when discussing vs. C# vs. MC++.

Brad Wilson
Monday, March 25, 2002

In 1997 there was an ActiveX control called Janus Grid (it exists now, but I'm not sure how it is implementd). It was written in VB. And it was FASTER than C++ implementations from Developer Express.
You can always safely assume two things:
1. There is no correlation between quality of compiler/language and speed of your code.
2. You don't know where performance problem is. You have to measure.
In most times when you see your program is slow - believe me - it is doing stupid unnecessary loops or using promotive algorithms, not compiling pseudocode.

P.S. New Developer Express .NET grid is written in C#, and it faster in times than older ActiveX C++ implementation.

Roman Eremin
Tuesday, March 26, 2002

>Of course, the rules completely change when discussing > vs. C# vs. MC++.

Not having really looked at C#/.Net that much - could you explain what you mean? I'm actually curious to know if it's something I should be learning now (instead of MFC) or if's going to be feasible to continue programming with the windows API and MFC when needed.

Tuesday, March 26, 2002

My rule of thumb is that developing a complex application is about 10 times faster using VB, compared with VC++. For business apps, the performance difference is not significant.

For graphics intensive applications, some operations are 100 times faster in VC++ ( i.e. C++ ) compared with VB. So, generally, graphics or CPU intensive applications are best written in C++.

It can be useful to package these as COM components that are then used inside a VB app. This combines good performance, quick development and easy improvements to the UI.

With Direct X, C++ is best for any serious work.

Tony Healy
Tuesday, March 26, 2002

> With Direct X, C++ is best for any serious work.

Why is that? Just being curious, I must admit I don't know VB, I work with DirectDraw under C++, but it seems to me that you can call almost all DirectDraw functions and use almost all DirectDraw objects from VB, too (there are some exceptions though).

Since you call the same COM objects from VB or VC++ (as far as I get it), there should not be much performance difference in the DirectDraw calls themself. I agree that C++ is probably the faster solution if you want to do a lot of low level data manipulation (just thinking DirectDraw 2D graphics here, mostly bitmap manipulation). But don't you think that those bltting, clipping, flipping things should be almost as fast in VB?

As I said, just asking, I have no idea if this makes sense,

have fun,

Jutta Jordans
Tuesday, March 26, 2002

It's probably a waste of time to mention this, but I'll say it anyway. If you use Delphi or C++ Builder, you get the speed of development of VB (x times faster than VC++) without the tradeoffs that VB involves. So you still get a native stand-alone executable, optimizing compiler, full access to the Win32 API, etc. And there are all the profits of using a more structured and more powerful language than Basic.

Frederik Slijkerman
Tuesday, March 26, 2002

The reason I say the rules change for .NET is because all languages are more or less on an even playing field. There's no reason to expect the large (potential) performance differences of VB6 vs. VC++6, which were due to one being a semi-managed platform and one being a purely unmanaged platform.

In the .NET world, everything is more like VB6 than VC++6 as far as the execution environment is concerned (most like the JVM, but that hadn't been brought up yet <grin>).

Brad Wilson
Thursday, March 28, 2002

<h1>this is an HTML tag</h1>

Bill Gates
Wednesday, October 23, 2002

The basic difference between VB and VC++ is that the VB is Object based and VC++ is Object oriented.

VB allows us to alter the system generated code upto some extent where as VC++ gives full freedom.

VC++ supports native methods where as VB doesn't

VC++ can be used to implement Graphics applications efficiently and VB can be used to build UI effectively.

VC++ code is unmanaged on the other hand VB code is partially managed.

Tuesday, December 23, 2003


I am writing a small script to get the ip address which it can take into DWORD format from the IP control. If I am using the MessageBox(<var-name>), It says, it can't convert LPCTSTR to DWORD (The Ip is feeded into DWORD format).
Can anybody please tell me how can I display this into a MessageBox or somthing else similar.


Kuldeep Kumar
Friday, April 16, 2004

*  Recent Topics

*  Fog Creek Home