In most languages, there are many different types of loops. The most common ones seem to be for loop, while loops, and do while loops.
What is the best way to illustrate the differences between the loops, not in terms of syntax, but in terms of recommended usage. For example, a while loop with an iterator variables can usually be replaced by a for loop. A while true
loop with a break statement at the end could be better expressed as a do while loop.
How can I get my students to use the correct loops in each situation? How can I show them when a loop can be better expressed in another form?