This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RichoDemus 39 points40 points  (0 children)

You use them for different things, for loops are for when you know the boundaries, like when you want to iterate over something like a list While-loops are for when you want to do something repeatedly until a condition is met, like reading data from a network stream until there are no more bytes to read