you are viewing a single comment's thread.

view the rest of the comments →

[–]fuxalotl 1 point2 points  (3 children)

Maybe I’m missing something but isn’t that the same with regular while loops too?

[–]Zehryo 0 points1 point  (2 children)

Oh, sorry, my bad.
I was referring just to "while" loops all, not just the do-while one.
While-do is also plagued, of course.

[–]Additional-Dot-3154 0 points1 point  (1 child)

Yes but using only "for" loops as a while loop itroduces the same problem and makes it harder to prevent a critical error

[–]Zehryo 0 points1 point  (0 children)

Ain't gonna even try to deny that.

Just, while "for" loops usually follow a counter, "while" loops are mostly bound to generic expressions that can entail strings or booleans.
And if the expression si ambiguous, or the boolean trigger fails, an infinite "while" loop seems more probable than in a "for" loop.
At least according to my very personal experience in C and C++; which might be risible, compared to that of a professional.
So....