Code Complete: A Practical Handbook of Software Construction, Second Edition

 < 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 > 

Категории