Programming often involves manipulating variables. Most procedures contain at least one variable, and some have dozens. Because variables are so common, they're often taken for granted. In Chapter 3, "Naming Conventions," I discussed using Hungarian prefixes to denote the data types of variables. Although using these prefixes should be mandatory whenever the variables are private to a class or module, it's only the beginning of properly handling variables. A well-defined variable has a clearly defined data type and scope. In addition, to correctly use variables you must explicitly declare them using intelligent variable names and you must give them focus.
Goals of Using Variables AppropriatelyThe goals of explicitly declaring variables and using a consistent variable-naming scheme are
|