Or even old loop constucts
Or even old loop constucts
Posted Jul 5, 2013 14:51 UTC (Fri) by etienne (guest, #25256)In reply to: Or even old loop constucts by NRArnot
Parent article: Philosophy and "for" loops — more from Go and Rust
The difference is that you may not want to end the loop either at the beginning or at the end - maybe you have to do something once even if the loop shall not be executed once.
You can also sometimes simplify the exit test by writing multiple "if (cond) break;", in complex tests lie more bugs.
I usually do not use "while(1)" because Quality says not to have literal numbers, nor one of the "while (true)", "while (True)", "while (TRUE)", nor "while (!false)", but "for (;;)" - there is no "always true" warning to get when there is no test.
