Key Points

 < Free Open Study > 

  • Good variable names are a key element of program readability. Specific kinds of variables such as loop indexes and status variables require specific considerations.

  • Names should be as specific as possible. Names that are vague enough or general enough to be used for more than one purpose are usually bad names.

  • Naming conventions distinguish among local, class, and global data. They distinguish among type names, named constants, enumerated types, and variables.

  • Regardless of the kind of project you're working on, you should adopt a variable naming convention. The kind of convention you adopt depends on the size of your program and the number of people working on it.

  • Abbreviations are rarely needed with modern programming languages. If you do use abbreviations, keep track of abbreviations in a project dictionary or use the standardized prefixes approach.

  • Code is read far more times than it is written. Be sure that the names you choose favor read-time convenience over write-time convenience.

 < Free Open Study > 


Code Complete
Code Complete: A Practical Handbook of Software Construction, Second Edition
ISBN: 0735619670
EAN: 2147483647
Year: 2003
Pages: 334

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net