Originally Posted by Maven
The way visual basic works internally is much different from C++. That is why you see a speed difference, because microsoft made visual basic very simple. Visual basic is a very object based langauge, everything from array variables to the functions you rely on are all OLE objects. A good example of this is to look at the internals of an array. One thing you will find that all visual basic arrays are actually OLE_SAFEARRAY structures. When you call LEN(String) for example, you don't actually perform any calculations on the variable, it reads a memory address. That is why you will never write a better len function then the one visual basic provides. In fact calling len multiple times in visual basic on a large string would more then likely be faster then doing the same in C++ using strlen.
In C++, you have the ability to work with the strings and arrays in the same fasion as visual basic. You will also make the same sacrafices in speed that microsoft made with their design of vb. MFC is a good example of sacrafice in the name of simplicity. Just like visual basic, if you use MFC, you wouldn't have the ability to make much use of directx graphics because the method is too slow. In a nutshell, the more high level layers you add onto a language, the slower it will become.