|< Day Day Up >|
This book contains a detailed description of the Visual Basic .NET programming language. It is intended to help new programmers to learn to program in Visual Basic .NET and to serve as a reference for experienced Visual Basic .NET programmers. In general, this book does not cover topics that are unrelated to the language itself, such as how to use the Windows Forms libraries to do GUI programming or the underlying design of the Common Language Runtime. It focuses first and foremost on the language itself, and discusses topics outside the language only to the degree that they are necessary to understand some part of the language design.
The book is laid out as follows : After a general overview of the language is given, concepts are arranged in order from the simplest to the most advanced. The book is intended to be read sequentially, although programmers with some prior experience in Visual Basic might find that skipping back and forth through the book will work just as well. The progression of concepts through the book starts with the basics of the language such as statements and expressions, moves on to the object-oriented programming (OOP) features of the language such as classes, and then finishes with advanced topics such as inheritance and versioning. Readers who are familiar with prior versions of Visual Basic are still encouraged to read through each chapter; changes occurred throughout the language when moving to the .NET Framework, and so even familiar topics may contain new features.
In general, when a concept is discussed, it is discussed in detail. For the reader new to programming, the .NET Framework, or Visual Basic, some of the details may seem difficult to grasp. Advanced concepts are usually highlighted and are not required for a working understanding of the language ”in practice, they can be skipped . Readers are encouraged not to get hung up on things that may not make sense, but instead to plow ahead and circle back later. Many times, advanced concepts earlier in the book may be simpler to understand once later concepts have been digested.
A Short, Unofficial History of Visual Basic
The original BASIC programming language was defined by John G. Kemeny and Thomas E. Kurtz at Dartmouth College in 1964. BASIC is an acronym for B eginner's A ll-purpose S ymbolic I nstruction C ode, and the language was intended to be easy for beginners to learn, yet powerful enough to write general-purpose programs. In 1975, a couple of programmers named Bill Gates and Paul Allen developed a version of BASIC for the Altair MIPS and started selling it through a small corporation they set up. That version of BASIC helped launch the Microsoft Corporation to some extraordinary heights, and since then Microsoft has had a BASIC product available in one form or another.
In 1991, BASIC at Microsoft took a major step forward with the introduction of Visual Basic. Based on an idea originally developed by Alan Cooper, Visual Basic wedded a version of the BASIC language to the new Windows user interface, resulting in a powerful tool for developing Windows applications. The concept took off, and today Visual Basic is the most widely used programming tool in existence. The fourth version of the Visual Basic product marked the introduction of the Common Object Model (COM), a framework for developing components that could plug into one another. COM was also extremely successful, forming a foundation technology for Windows and being used to build millions of components .
As successful as COM was, it had limitations. One of the biggest was that it was not always designed to work well with languages other than Visual Basic. This meant that, for example, programmers who used C++ often found it difficult and time consuming to program against COM components, especially those written in VB. Another problem was that COM only defined how components were supposed to interact with each other, leaving the actual details of this interaction, especially in terms of such things as component lifetime and memory management, up to the component author. Although Visual Basic provided these services to its programmers, other popular languages, such as C++, did not. Because each C++ programmer was required to implement these services themselves , implementations were not always compatible or complete, resulting in not only more work but also more bugs (and, by extension, more user anguish).
To try to address some of the shortcomings of COM, Microsoft began developing a replacement technology, the Common Language Runtime (CLR). In addition to defining component interactions, the CLR also took on the job of managing such things as memory and component lifetime, taking over those responsibilities from the programmer. Microsoft also began developing the .NET Framework, a set of class libraries that provided capabilities equivalent to the Win32 API, on top of the CLR. Together, the .NET Framework and the CLR form the foundation of the next generation of Windows programming.
Although the CLR is intended as a replacement for COM, there are many differences between the two, some major, some extremely subtle. Because Visual Basic had become so integrated with COM, it was necessary to make corresponding changes to the language, some of which significantly altered the way programs were written in VB. As a result, Visual Basic .NET, a new and distinct version of the Visual Basic language, was developed. Although most of the language came through unchanged by the transition, some details of the language were modified, and many new concepts were added.
Where practical, things that have changed from previous versions of Visual Basic are pointed out in a box labeled Compatibility, but a full accounting of the changes in the language between Visual Basic 6.0 and Visual Basic .NET is beyond the scope of this book.
|< Day Day Up >|