An oft-taught rule of thumb in programming classes, and a generally handy way to think about it, is this:
If you aren't sure how many times a loop might run (it could be one time or a hundred times, like when searching for something in a tree), use
If you you can define precisely how many times a loop will execute, such as 10 times, or on a set range of items (like the first n items of a list), use
Strictly speaking, you don't need for or while loops in any language that has
goto or repeatedly executed
while loops also have the dubious distinction of being probably the most common source of infinite loop bugs in modern programming languages, and they tend to expand the current scope with unneeded iterator variables unless you use a closure (and a language that supports closures, of course). For beginners, they can be a real pain.
For experienced programmers, it's best to understand the idioms of the language and what each type of loop is commonly understood to represent, and to avoid shoe-horning one's one personal preferences onto every problem if the code is ultimately meant for other people's consumption.
I, on the other extreme, tend to prefer
for-range (in languages that have them) and have to force myself to use
while loops when they seem most appropriate.
It need not be a religious thing - just learn the use of all basic building blocks of language and especially all the finer ins and outs of control structures when you can, and you'll find it's time very well spent.