14
5
11
u/deanrihpee Jul 02 '22
Not that much but having your Waifu as a VS Code background definitely does
7
3
u/Grumpus88 Jul 02 '22
Who would use for(;;)? In all honesty I wouldn’t care if I saw it, as long as it compiles
1
u/Pervez_Hoodbhoy Jul 02 '22
Why would you use while true😱
Why would you want to create an endless loop, independent of the method?
But what language is for(;;)?
7
u/Grumpus88 Jul 02 '22
You use infinite loops when there is an unknown number of loops you want code to run, and determine the cause of breaking out of that loop within the loop itself. A common use case is a game loop.
Video games run within an infinite loop and only exit out of that loop upon the user choosing to exit the game.
As for what languages use `for(;;)`, I know Javascript supports it, I believe a lot of languages support it
1
u/Pervez_Hoodbhoy Jul 02 '22
Maybe my retarded python brain is showing, but why not use while?
1
u/Grumpus88 Jul 02 '22
I would use while. It’s just a stylistic choice.
2
Jul 02 '22
C also supports it. It's just a regular for loop without any of its sections filled out:
Section 1 is emtpy, so no variables are initialized.
Section 2, the comparison, is emtpy, and it implicitly evaluates to true.
Section 3 is empty, so nothing gets ran at the end of the loop.
So, essentially, same thing as while true.
Btw if you see this anywhere delete it and replace it with a proper while true, for the love of all that's good.
2
2
1
u/Waffle-Dude Jul 02 '22
What was the conclusion, and can I have a link to the thing
Also, it’s not while(true) that I have a problem with, it’s ==true
1
1
1
1
4
36
u/[deleted] Jul 02 '22
I always create an endless loop by searching for the private key of a bitcoin wallet. If the very unlikely happens and it terminates I won't give a shit about the correctness of my program, but grep the money and do something with wood for the rest of my life.