"For" infinite loop

bearophile bearophileHUGS at lycos.com
Sat Aug 11 13:38:31 PDT 2012


bioinfornatics:

> n this case why not using a while loop ?

It uses less lines of code, and with the for loop you have a 
single place where to put the loop variable initialization, test 
and increment. This makes the code simpler to read. In this case 
the test is moved inside the loop, but it's better still than a 
regular while loop.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list