| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (6 out of 6)

Using Coding Conventions for Methods, Procedures, and Rules

You can greatly enhance the readability and maintainability of your methods, procedures, and rules by following consistent style conventions for naming and indentation.

Naming Conventions

Follow these naming conventions for local variable names and symbols:

Indentation Conventions for Methods and Procedures

To increase readability, you should place blocks of code within the same control boundaries at the same level of indentation. Specifically:

The following examples illustrate the standard use of indentation.

"Begin" Statement

"Repeat" and "For...Do" Statements

"If-Then-Else" Statement

"Case" Statement

"On error" Statement

"Collect data" Statement

Examples of Properly Indented Procedures

Here are two examples that illustrate correct indentation for procedures:



Indentation Conventions for Rules

Similar to the indentation conventions you use for methods and procedures, you should place blocks of code within the same control boundaries of a rule at the same level of indentation. Specifically:

Examples of Properly Indented Rules

Here are two examples of rules that follow these indentation conventions:



| Prev | Next | Start of Chapter | Next Chapter | Contents | Glossary | Index | Comments | (6 out of 6)

Copyright © 1997 Gensym Corporation, Inc.