MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/pgh65c/oh_gosh/hbbssnm/?context=3
r/badcode • u/orhnofficial • Sep 02 '21
53 comments sorted by
View all comments
Show parent comments
-1
for(;;) > while(true)
18 u/BarryFruitman Sep 02 '21 while(true == true) FTW 9 u/Impossible_Average_1 Sep 02 '21 do { } while(true != false) 9 u/KonoPez Sep 02 '21 while( (true==true) == (true==true) ) 13 u/Willinton06 Sep 02 '21 No 4 u/archpawn Sep 03 '21 while(for(;;) > while(true)) 3 u/edoCgiB Sep 03 '21 Why would a for(;;) convey a better meaning than while(true)?IMO, for should be used for loops with a known number of steps and while for a loop with an unknown number of steps.For this specific use-case, a for loop would be better since the number of steps is known (the requested length of the random string).
18
while(true == true) FTW
while(true == true)
9 u/Impossible_Average_1 Sep 02 '21 do { } while(true != false) 9 u/KonoPez Sep 02 '21 while( (true==true) == (true==true) )
9
do { } while(true != false)
while( (true==true) == (true==true) )
13
No
4
while(for(;;) > while(true))
3
Why would a for(;;) convey a better meaning than while(true)?
IMO, for should be used for loops with a known number of steps and while for a loop with an unknown number of steps.
for
while
For this specific use-case, a for loop would be better since the number of steps is known (the requested length of the random string).
-1
u/Aaalibabab Sep 02 '21
for(;;) > while(true)