Key Points

 < Free Open Study > 

  • Loops are complicated. Keeping them simple helps readers of your code.

  • Techniques for keeping loops simple include avoiding exotic kinds of loops, minimizing nesting, making entries and exits clear, and keeping housekeeping code in one place.

  • Loop indexes are subjected to a great deal of abuse. Name them clearly, and use them for only one purpose.

  • Think through the loop carefully to verify that it operates normally under each case and terminates under all possible conditions.

 < 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