Dan Mabbut, About.com Visual Basic Guide, Dec 2002
Product Description
Most Visual Basic .NET books are written for experienced object-oriented programmers, but many programmers jumping on the .NET bandwagon are coming from non-object-oriented languages, such as Visual Basic 6.0 or from script programming, such as JavaScript. These programmers, and those who are adopting VB.NET as their first programming language, have been out of luck when it comes to finding a high-quality introduction to the language that helps them get started.
That's why Jesse Liberty, author of the best-selling books Programming C# and Programming ASP.NET, has written an entry-level guide to Visual Basic .NET. Written in a warm and friendly manner, this book assumes no prior programming experience, and provides an easy introduction to Microsoft's most popular .NET language.
Learning Visual Basic .NET is a complete introduction to VB.NET and object-oriented programming. This book will help you build a solid foundation in .NET, and show how to apply your skills by using hundreds of examples to help you become productive quickly. Learning Visual Basic .NET introduces fundamentals like Visual Studio .NET, a tool set for building Windows and Web applications. You'll learn about the syntax and structure of the Visual Basic .NET language, including operators, classes and interfaces, structs, arrays, and strings. Liberty then demonstrates how to develop various kinds of applications--including those that work with databases--and web services.
By the time you've finished Learning Visual Basic .NET, you'll be ready to move on to a more advanced programming guide that will help you create large-scale web and Windows applications.
Whether you have a little object-oriented programming experience or you are new to programming altogether, Visual Basic .NET will set you firmly on your way to mastering the essentials of the VB.NET language.
About the Author
Jesse Liberty is the best selling author of Programming ASP.NET, Programming C#, and a dozen other books on web and object oriented programming. He is president of Liberty Associates, Inc., where he provides contract programming, consulting and on-site training in ASP.NET, C#, C++ and related topics. Jesse has been a Distinguished Software Engineer at AT&T and Vice President for technology development at CitiBank.
Excerpted from Learning Visual Basic NET by Jesse Liberty. Copyright © 2002. Reprinted by permission. All rights reserved.
You can use VB.NET to create three different types of programs:
Web applications
Windows applications
Console applications
The .NET platform is web-centric. The VB.NET language was developed to allow .NET programmers to create very large, powerful, high-quality web applications quickly and easily. The .NET technology for creating web applications is called ASP.NET.
ASP.NET, the next generation from ASP (Active Server Pages), is composed of two Microsoft development technologies:Web Forms and Web Services. While the development of fully realized web applications using these technologies is beyond the scope of this book, learning the basics of the VB.NET language will certainly get you started in the right direction. VB.NET is generally acknowledged to be one of the languages of choice for ASP.NET development.
Typically, youll create an ASP.NET application when you want your program to be available to end users on any platform (e.g., Windows, Mac, Unix). By serving your application over the Web, end users can access your program with any browser. When you want the richness and power of a native application running directly on the Windows platform, alternatively you might create a desktop-bound Windows application. The .NET tools for building Windows applications are called Windows Forms; a detailed analysis of this technology is also beyond the scope of this book.
However, if you dont need a GraphicalUser Interface (GUI) and just want to write a simple application that talks to a console window (i.e., what we used to call a DOS box), you might consider creating a console application. This book makes extensive use of console applications to illustrate the basics of the VB.NET language. Web, Windows, and console applications are described and illustrated in the following pages.
Console applications
A console application runs in a console window, as shown in Figure 2-1. A console window (or DOS box) provides simple text-based output.
Console applications are very helpful when learning a language because they strip away the distraction of the GraphicalUser Interface. Rather than spending your time creating complex windowing applications, you can focus on the details of the language constructs, such as how you create classes and methods, how you branch based on runtime conditions, and how you loop. All these topics will be covered in detail in coming chapters.
Windows applications
A Windows application runs on a PCs desktop. You are already familiar with Windows applications such as Microsoft Word or Excel. Windows applications are much more complex than console applications and can take advantage of the full suite of menus, controls, and other widgets youve come to expect in a modern desktop application. Figure 2-2 shows the output of a simple windows application.
ASP.NET applications
An ASP.NET application runs on a web server and delivers its functionality through a browser, typically over the Web. ASP.NET technology facilitates developing web applications quickly and easily. Figure 2-3 shows a message from a simple ASP.NET application.
Although most commercial applications will be either Windows or ASP.NET programs, console applications have a tremendous advantage in a VB.NET primer. Windows and ASP.NET applications bring a lot more overhead;there is great complexity in managing the window and all the events associated with the window. (Events are covered in Chapter 18.) Console applications keep things simple, allowing you to focus on the features of the language.
Whats in a Program?
A program consists of English-language instructions called source code . The syntax for these instructions is strictly defined by the language. Source code consists of a series of statements. A statement is an instruction to the complier. Each instruction must be formed correctly, and one task youll face when learning VB.NET will be to learn the correct syntax of the language. For example, in VB.NET every statement ends with a carriage return or linefeed.
Each instruction has a semantic meaning that expresses what it is you are trying to accomplish. Although you must follow the syntax, the semantics of the language are far more important in developing effective object-oriented programs. This book will provide insight into both the syntax and the semantics of good VB.NET programs.
You will save the source code you write in a text file. You can write this source code file using any simple text editor (such as Notepad), or you can use the Visual Studio .NET Integrated Development Environment (IDE). Visual Studio .NET is described in Chapter 4.
Once you write your program, you compile it using the VB.NET compiler. The end result of compiling the program is an application.