Plzz Explain !!

R

Richard Bos

Malcolm said:
Horrible. Fortran "for" wouldn't allow it.

Yeah, and it isn't in BASIC, either. Isn't it just _awful_?
My view is that for loops are for when you know the number of iterations on
loop entry. If it is some sort of dynamic condition, while() makes more
sense.

You use for when you run over a specific set; whether that set is a
subset of the integers or a linked list is immaterial. You use while
when you depend on a condition that doesn't involve a set of objects.
This is inherent inthe English language meaning of the words.
for fifteen times, do this

That's dialectal English, though. I never hear that outside parodies of
the Southern Belle accent. Normally, one would use "do this fifteen
times", not "do this _for_ fifteen times". By contrast, one _would_ say
"do this for all items in this box" or "do this for all guests who
arrive".

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top