June 18th, 2004, 8:20 pm
Most of the above discussion is correct and informative, but it looks like some of the respondents are glossing over the difference between VBA and plain VB.VBA == 'Visual Basic for Applications' is Microsoft's version of Visual Basic that is 'hosted' inside a bunch of Microsoft applications (primarily Office, but also Visual Studio and a few others). If you want to write code that is tightly integrated with one of the Office apps, then VBA is usually the way to go - the VBA development environment is included with the app, the application's macro recorder produces VBA code, and accessing all the features of the app is usually quick and easy. VBA isn't a full-fledged object-oriented programming language by any means, but it does have a decent set of 'object style' features, and it is possible to write a good-sized VBA 'application' that is well-structured and quite maintainable.As others have already explained, C++ is a full-fledged, general purpose object oriented programming language. C++ is extremely flexible, is available on many different platforms and OSes, and is particularly good for low-level, high efficiency work. The main practical problems with C++ are: - C++ is TOO flexible. There tend to be multiple ways to do things, many of which are confusing and bug-prone. (There are two classic books by Scott Meyers, "Effective C++" and "More Effective C++", which are substantially devoted to explanations of how seemingly benign bits of code will break your program in strange and horrible ways.) C++ is not very good at protecting you from your mistakes, and we all make mistakes. - conventional C++ style tends to be dense and obscure. It is possible to write beautifully clear and readable C++ code, but most programmers don't seem to do so. This means that if you are going to work with other people's C++ code, you are should probably expect a very steep learning curve and a lot of tough sledding.If you want a general-purpose modern OO language that is more forgiving than C++, look at Java.If you are coding on Windows (which is the only place you can use VBA anyway, outside of the Macintosh version of Office), then look at C#.NET or VB.NET, which are more or less identical as far as functionality goes, and which have an excellent development (Visual Studio), a rich standard library (not quite as zippy as the C++ STL in terms of algorithms and data structures, but a lot broader and more useful for general purpose application development, since it includes GUI, database, XML, etc.) VB.NET and VBA have similar 'look and feel' as far as basic syntax goes, but VB.NET is a 'real' full-blown OO language, with proper inheritance.The importance of 'raw speed' of programming languages tends to be vastly over-emphasized, IMHO. For most practical purposes, a good development environment and libraries, solid program design and intelligent choice of algorithms are all much more important for producing high-quality, maintainable applications on time and on budget.