Key Points

 < Free Open Study > 

  • The most important reason for creating a routine is to improve the intellectual manageability of a program, and you can create a routine for many other good reasons. Saving space is a minor reason; improved readability, reliability, and modifiability are better reasons.

  • Sometimes the operation that most benefits from being put into a routine of its own is a simple one.

  • You can classify routines into various kinds of cohesion, but you can make most routines functionally cohesive, which is best.

  • The name of a routine is an indication of its quality. If the name is bad and it's accurate, the routine might be poorly designed. If the name is bad and it's inaccurate, it's not telling you what the program does. Either way, a bad name means that the program needs to be changed.

  • Functions should be used only when the primary purpose of the function is to return the specific value described by the function's name.

  • Careful programmers use macro routines with care and only as a last resort.

 < 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