Key Points

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

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.213.212