Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 917 Bytes

File metadata and controls

36 lines (28 loc) · 917 Bytes

Code Complete Variable Checklist

General

  • Variables declared close to where theyre used
  • Variables have the smallest scope possible
  • Variables are bound at the appropriate time

Naming Considerations

  • Names fully and accurately describe what the variable represents
  • Name refers to real world problem - not the programming language solution

Conventions

  • Conventions distringuish between data types
    • local
    • class
    • global
  • Conventions distinguish between variables
    • named constants
    • enumerated types
    • regular variables

Names to Avoid

  • easy to misread
  • easy to mispronounce
  • easy to misspell
  • misleading
  • similar meanings
  • differ by only one or two characters
  • sound vamiliar
  • use numerals
  • totally arbitrary
  • hard to read characters