Previous versions of Visual Basic generated an intermediate code form called
p-code. Code in this format had its advantages, but it couldn’t match the native code performance of true compiled languages such as C. This version of Visual Basic finally offers a compiler, promising to break the Visual Basic speed limits.
How well does compiled Visual Basic meet that promise? We’ll be examining the sometimes surprising answer to that question in this book. In the past, there were certain things that you did in Visual Basic. There were certain other things that you didn’t even attempt. Why bother doing processor-intensive programming in p-code?
In the previous version of this book, I said that if you were willing to use two langauges, you could get the best of both worlds. Use Visual Basic for what it does best—creating user interfaces quickly with the most efficient development and debugging environment available. Use C++ (or Pascal or whatever) for the meat of your program, the parts where no sacrifice of performance or functionality is acceptable, no matter what the cost. I hinted that my next book would tell you how to write C++ objects for Visual Basic. And I did attempt to write that book, but unforseen circumstances prevented me from finishing it.
Along the way, however, a surprising thing happened whenever I mentioned in mail or in conversation that I was writing a book on C++ for Visual Basic programmers. People didn’t want it. In fact, some of them seemed to feel betrayed that I would even consider such a thing. Even in the version 4 time frame it was common knowledge that the next version of Visual Basic would have a compiler. Why would anybody want to write code in C++ if they could write the same code more easily in Visual Basic and then watch it run almost as fast—and with fewer bugs?
Why indeed? Is the two-language solution finally dead? Can you write fast, small programs with sophisticated user interfaces—and do it fast—in just one language? We’ll find out. This book is all Visual Basic. You decide for yourself whether it’s fast enough.