Chapter 3: Understanding Programming Basics


Overview

In this chapter, you will learn how to:

  • Use expressions, variables, and constants.

  • Use procedures.

  • Use flow control statements.

  • Handle errors.

  • Use object-oriented programming techniques.

This chapter is intended for readers who have little or no direct programming experience. It’s designed to give a brief overview of some basic programming concepts that will help you better understand the examples presented throughout the book. Readers with programming experience might want to skip this chapter and move on to Chapter 4.

While this chapter will provide an overview of basic programming concepts, I encourage readers with little hands-on programming experience to use other resources to supplement this information. These resources include books on programming basics, Web sites such as the Microsoft Developer Network (MSDN) site (http://msdn.microsoft.com), and newsgroups and mailing lists. (Microsoft maintains a large number of newsgroups on development topics related to Microsoft tools at news://msnews.microsoft.com. You can read from and post to these newsgroups using a newsreader such as Microsoft Outlook Express.) And the ASP.NET development team at Microsoft has just launched a set of discussion forums on ASP.NET that promise to be a great resource as well. You can find these forums at http://www.asp.net/forums/.

Of course, one of the best (and most overlooked) resources for programming concepts in Microsoft Visual Basic .NET is the MSDN documentation that ships with Visual Basic .NET (a subset of which is also available as part of the quarterly MSDN library, which you can order from http://msdn.microsoft.com/subscription). The MSDN documentation contains samples, tutorials, language references, and specifications for Visual Basic .NET, Microsoft Visual C# .NET, managed extensions for C++, and JScript .NET.

This chapter will discuss how these basic programming concepts apply to ASP.NET, and how you can use them to create effective ASP.NET applications. Although most of these concepts aren’t language-specific, there are some subtle differences in how they’re implemented in C# vs. Visual Basic .NET or other .NET languages.

Note

In ASP.NET, all code is contained in either Web Forms pages, code- behind modules, or modules that make up class libraries that are external to your ASP.NET applications. The term module in this sense refers to the .cs or .vb file that contains the code, while module as referred to by the Visual Basic .NET documentation is a container of code that is made available to other classes and modules within the same namespace. Unless otherwise specified, the term module in this book has the former meaning rather than the latter.

A class, as you’ll see in “Using Classes as Containers for Code” later in this chapter, is a special type of code container that provides a number of useful features. Classes are contained within modules (that is, files with the extension .cs or .vb).

A namespace contains one or more classes, and can be defined in one or more modules. Namespaces can be used to prevent name collisions when two classes have the same name.




Microsoft ASP. NET Programming with Microsoft Visual Basic. NET Version 2003 Step by Step
Microsoft ASP.NET Programming with Microsoft Visual Basic .NET Version 2003 Step By Step
ISBN: 0735619344
EAN: 2147483647
Year: 2005
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net