Visual Basic Coding Standards

Naming Conventions

These naming conventions allow program readers to recognize many program objects at a glance. For example, DocumentType is a type, btnStart is a command button, and MEMORY_ERROR is a named constant.

Formatting

Types

Expressions

Control Structures

Functions and Subroutines

Forms, Modules, and Access to Program Objects

Visual Basic code appears in forms and modules. Forms are containers for controls; modules contain code not associated with controls. The content of forms is dictated by the controls that appear on them, but additional code may be added to them. All functions and subroutines appearing in forms are inaccessible outside the form, so only code for local form processing should be included in a form. The content of modules is entirely under the control of the programmer. Functions and subroutines placed in modules are accessible outside the module unless declared Private. Code placed in modules should reflect program structure, with emphasis on principles of cohesion, coupling, and information hiding. In particular, place implementations of abstract data types in separate modules.

Comments

Error Checking

Target Metric Values


Return to Home Page

Copyright 1999 Christopher Fox