Program Structure and Code Conventions
The document is archived and information here might be outdated

Program Structure and Code Conventions

This section introduces the typical Visual Basic program structure, provides a simple Visual Basic program, "Hello World", and discusses Visual Basic code conventions. Code conventions are suggestions that focus not on a program's logic but on its physical structure and appearance. Following them makes your code easier to read, understand, and maintain. Code conventions can include, among others:

  • Standardized formats for labeling and commenting code.
  • Guidelines for spacing, formatting, and indenting code.
  • Naming conventions for objects, variables, and procedures.

The following topics present a set of programming guidelines for Visual Basic programs, along with examples of good usage.

In This Section

Structure of a Visual Basic Program
Provides an overview of the elements that make up a Visual Basic program.
The Visual Basic Version of Hello World!
Provides a step-by-step recreation of the classic program "Hello World," redone in Visual Basic .NET.
Visual Basic Naming Conventions
Includes general guidelines for naming procedures, constants, variables, arguments, and objects.
Breaking and Combining Statements in Code
Shows how to divide long statements into multiple lines and combine short statements on one line.
Special Characters in Code
Shows how and where to use non-numeric and non-alphabetic characters.
Comments in Code
Discusses how to add descriptive comments to your code.
Visual Basic Limitations
Discusses the removal of known coding limits within Visual Basic.
Conditional Compilation
Provides links to topics about how to compile particular blocks of code selectively while directing the compiler to ignore others.

Related Sections

Typographic and Code Conventions
Provides standard coding conventions for Visual Basic .NET.
Coding Techniques and Programming Practices
Provides an overview of coding techniques throughout Visual Studio .NET.
Editing Code, HTML, and Text
Provides an overview of the Visual Studio .NET Code Editor.
© 2016 Microsoft