Next: Two Examples
Up: Good Style
Previous: Indentation

PARAMETER Statements for Named Constants

Named constants are useful things and PARAMETER statements are how you define them (not to be confused with the parameters to a function or subroutine!). The same guidelines for choosing a name for a variable apply to choosing the name for a constant. Using a named constant in a program avoids the ``magic number'' problem. When you encounter a constant (i.e. a number) in a program, its hard to know where that number came from, and more importantly WHY that particular number. Using a PARAMETER statement makes things clearer to the next reader.


Next: Two Examples
Up: Good Style
Previous: Indentation

Hamlet Project
hamlet@cs.utah.edu