Flylib.com

Books Software

 
 
 

- page 5


Credits

  • Executive Editor
    Robert Elliott

  • Development Editor
    Kevin Shafer

  • Technical Editor
    John Mueller

  • Copy Editor
    Travis Henderson

  • Editorial Manager
    Mary Beth Wakefield

  • Production Manager
    Tim Tate

  • Vice President and Executive Group Publisher
    Richard Swadley

  • Vice President and Executive Publisher
    Joseph B. Wikert

  • Compositor
    Laurie Stewart, Happenstance Type-O-Rama

  • Proofreader
    Kathryn J. Duggan

  • Indexer
    Melanie Belkin

  • Anniversary Logo Design
    Richard Pacifico



Introduction

Overview

When Visual Basic first appeared, it revolutionized Windows programming. By handling many of the tedious details of processing Windows events, it enabled programmers to focus on application details instead of Windows programming trivia.

Unfortunately, early versions of Visual Basic had a few drawbacks. Protection from the underlying Windows details came at the price of reduced flexibility. Using Visual Basic meant that you didn’t need to mess with the sticky details of Windows event loops , but it also made working directly with those events more difficult when you really wanted to. Advanced programmers could still pry off the cover and work at this lower level, but this was somewhat dangerous. If your code didn’t handle all the details correctly, it could crash the program and possibly Windows itself.

Visual Basic also followed a path different from that taken by other Windows programming languages such as C++. It provided a more productive development environment and a generally more intuitive syntax. Its syntax for object-oriented development was more restrictive , however. A developer could still build safe, reliable, extensible applications, but it took some experience and care.

Visual Studio .NET addressed many of these shortcomings. It merged the Visual Basic and C++ development environments into an even more powerful tool. It added the C# language (pronounced “C-sharp”) and gave all three a common underlying runtime language called Common Language Runtime (CLR). Visual Basic .NET incorporated changes to bring the language more into line with CLR and the other languages. It included more structured error handling, new syntax for declaring and initializing variables , overloaded functions and subroutines, and a more powerful model for creating classes that include true inheritance.

Visual Basic 2005 adds new features that make Visual Basic a more powerful language than ever. It includes new language features such as unsigned data types, operator overloading, and short-circuit logical operators; object-oriented enhancements such as more flexible property procedure accessibility, generics, and custom events; and coding improvements such as Extensible Markup Language (XML) comments, better IntelliSense, and code snippets.

Visual Basic 2005 is the second major release of this programming language. Most of the obvious bugs in the first release (surprisingly few for such a major reshaping of the language) have been ironed out, so there has never been a better time to learn the language. The first release has proven stable and the current release brings new capabilities to Visual Basic programmers. Developers waiting to see what would become of Visual Basic .NET have their answer: It is here to stay.



Should You Use Visual Basic .NET?

A Visual Basic programmer’s joke asks, “What’s the difference between Visual Basic .NET and C#? About three months!” The implication is that Visual Basic .NET syntax is easier to understand, and building applications with it is faster. Similarly, C# programmers have their jokes about Visual Basic .NET, implying that C# is more powerful.

In fact, Visual Basic .NET is not a whole lot easier to use than C#, and C# is not significantly more powerful. The basic form of the two languages is very similar. Aside from a few stylistic differences (Visual Basic is line-oriented; C# uses lots of braces and semicolons), the languages are comparable. Both use the Visual Studio development environment, both provide access to the .NET Framework of support classes and tools, and both provide similar syntax for performing basic programming tasks .

In fact, the languages are so similar that many of Microsoft’s web pages lump the two together. For example, the page http://msdn.microsoft.com/library/en-us/vbcon/html/vboriWhatsNewVB70.asp is titled “What’s New in Visual Basic and Visual C#.”

The main difference between these languages is one of style. If you have experience with previous versions of Visual Basic, you will probably find Visual Basic .NET easier to get used to. If you have experience with C++ or Java, you will probably find C# (or Visual C++ or Visual J#) easy to learn.

Visual Basic does have some ties with other Microsoft products. For example, Active Server Pages (ASP) uses Visual Basic to create interactive web pages. Microsoft Office applications (Word, Excel, PowerPoint, and so forth) and many third-party tools use Visual Basic for Applications (VBA) as a macro programming language. If you know Visual Basic, you have a head start in using these other languages. ASP and VBA are based on pre-.NET versions of Visual Basic, so you won’t instantly know how to use them, but you’ll have a big advantage if you need to learn ASP or VBA.

If you are new to programming, either Visual Basic .NET or C# is a good choice. I think Visual Basic .NET may be a little easier to learn, but I may be slightly biased because I’ve been using Visual Basic lately. You won’t be making a big mistake either way, and you can easily switch later. Of course, if you have already bought this book, you should stick with Visual Basic to get the most benefit.