Skip to Content
Write Great Code, Volume 2, 2nd Edition
book

Write Great Code, Volume 2, 2nd Edition

by Randall Hyde
August 2020
Intermediate to advanced
656 pages
16h 15m
English
No Starch Press
Content preview from Write Great Code, Volume 2, 2nd Edition

14ITERATIVE CONTROL STRUCTURES

image

Most programs spend the majority of their time executing machine instructions within a loop. Therefore, if you want to improve your applications’ execution speed, first you should see if you can improve the performance of the loops in your code. This chapter will describe the following varieties of loops:

  • while loops

  • repeat..until/do..while loops

  • forever (infinite) loops

  • for (definite) loops

14.1 The while Loop

The while loop is perhaps the most general-purpose iterative statement that HLLs provide, so compilers generally work hard at emitting optimal code for it. The while loop tests a Boolean expression at the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Write Great Code, Volume 3

Write Great Code, Volume 3

Randall Hyde

Publisher Resources

ISBN: 9781098125653