Datasheet
IDE
Visual Studio is an excellent integrated development environment (IDE) for programming and debug-
ging code. IntelliSense makes it easier to correctly enter complex parameter lists. Breakpoints and
watches make stepping through code easy. The call stack browser lets you jump through the code to see
how pieces call each other.
Other languages provide their own IDEs and, though some such as Delphi’s are quite good, Visual
Studio is an outstanding IDE.
Language Relatives
Visual Basic is a close relative to several other languages, including the following:
❑ VBA (Visual Basic for Applications) — Used as a macro language by the Microsoft Office products
and can be used for scripting in other applications.
❑ VBScript — Used in ASP applications to build interactive Web applications. VBScript is very
similar to the Visual Basic language. In contrast, JavaScript is more like VBScript than Java.
❑ Visual Basic “Classic” — Although Visual Basic .NET is different in many ways from Visual Basic 6
and earlier versions, the languages have much in common. As the “Y2K problem” showed,
software often lives far beyond its expected lifetime. While Visual Basic .NET is Microsoft’s path
of the future, legacy Visual Basic “Classic” applications will continue to need support and even
development for many years to come.
This makes translating code between these languages relatively easy, so applications that you write in
one may be useful in others. By using Visual Basic, you acquire skills and a code base that can be helpful
in building desktop, Web, and scripted applications.
While the syntax details of Visual Basic and C# differ, the languages have a common enough structure
that it’s not too hard for a Visual Basic developer to read C# code. Though translating C# code line-by-
line into Visual Basic is not as straightforward as translating VBA code, it is relatively easy to get the
general idea of C# code and then rewrite it. That gives Visual Basic developers another source for ideas
and solutions to common problems.
Garbage Collection
Although the garbage-collection scheme used by Visual Basic .NET has its drawbacks, it also has some
advantages. Memory allocation is often the most difficult part of C and C++ applications to debug and
maintain. If you forget to free allocated memory, the application has “memory leaks” and uses more and
more of the system’s memory over time. If you free the same memory twice, the memory system can crash.
If you forget that you have freed a piece of memory and then later try to use it, the program may crash.
The nature of these bugs often means problems are obvious only long after the program executes the
incorrect code. For example, suppose a program frees the memory holding an object. It may be much
later that the program tries to access that object, causing a crash. Because the effects of these errors may
occur long after their causes, these bugs can be extremely difficult to locate.
11
Chapter 1: Language Selection
05_053416 ch01.qxd 1/2/07 6:28 PM Page 11