Datasheet

Visual Basic’s garbage collection scheme avoids all of these problems by removing your memory man-
agement responsibility. When the garbage collector runs, it frees memory that cannot be accessed by the
application. If a piece of memory such as an object reference is still usable by the program, the garbage
collector leaves it alone. This prevents all of these memory-related bugs.
Large Talent Pool
It’s hard to find reliable data about the number of developers currently using Visual Basic. At one time,
Microsoft claimed there were more than 3.2 million Visual Basic 6 users (
msdn.microsoft.com/
isv/technology/vba/overview/default.aspx
). They have also claimed more than 3.5 million
Visual Studio users (
msdn.microsoft.com/vstudio/extend/vsta/default.aspx), although they
don’t specifically mention which version of Visual Studio, and 1 million Visual Basic .NET users
(
msdn.microsoft.com/netframework/technologyinfo/Overview/default.aspx).
Whatever the numbers, it’s clear that there are a lot of developers who use Visual Basic of one form or
another. This in itself doesn’t mean Visual Basic is the best language, but it does mean that there is a
large pool of Visual Basic talent available. It means there are active newsgroups and forums where you
can ask questions if you need help, and that there are plenty of developers that you can hire if you need
extra hands on a project.
Summary
Although Visual Basic is an excellent programming language, the choice of language is not always triv-
ial. Whether Visual Basic is right for you depends on your application.
Arguments that Visual Basic is less powerful or slower than languages such as C# are just plain wrong.
All high-level languages have about the same capabilities and any missing features are usually easy to
supply with a few well-chosen libraries. Still, Visual Basic does have a few legitimate drawbacks.
If you only need your application to run on Windows operating systems, then Visual Basic is fine. If you
need to run on other systems, you will need support for running IL code. Mono may be an acceptable
solution for Unix, Linux, Solaris, and Mac OS X, and there have been rumors that Microsoft is bringing
support for C# to the Mac OS, but support will probably be better on Windows platforms.
Visual Basic does not provide multiple inheritance, so if your application architecture requires multiple
inheritance, you may want to use another language. I have never seen a real-world application that truly
required multiple inheritance, so if you only use it in a few places, you may be able to redesign the appli-
cation slightly to avoid it. If all else fails, you can mimic multiple inheritance in limited cases by using a
facade design pattern.
Though Visual Basic .NET is as fast as C# and is much faster than earlier versions of Visual Basic, it is
still an interpreted language, and a truly compiled language may give better performance for extremely
CPU-intensive applications. Most applications are limited by factors other than CPU use, however.
Many applications spend most of their time waiting for user input, database requests, network access, or
file access, and making the code itself faster may not help much. If you are writing a high-performance
real-time application where every clock cycle counts, you may need to move to a truly compiled lan-
guage. However, for most applications, you can move selected CPU-intensive pieces of code into com-
piled libraries and call them from Visual Basic when necessary.
12
Part I: Design
05_053416 ch01.qxd 1/2/07 6:28 PM Page 12