I just came across a for(;;) while reading through MSDN on winsock.
What is the purpose of an empty for(;;) loop? Can not the exact same thing be accomplished with a while loop? Seems like tomayto-tomahto to me. If there is some significant purpose though, I'd much like to know.
Name:
Anonymous2009-03-14 16:43
Why weren't you reading through SICP?
Name:
Anonymous2009-03-14 16:45
What is the purpose of an empty for(;;) loop? Can not the exact same thing be accomplished with a while loop?
I thought that the question was ``what's an empty loop good for?'', but you worry about how to technically do one? HIBT?
At the risk of surely sounding like a newfag, no idea what HIBT means. I know how to make and use an empty for loop, but I can do the exact same thing with a while loop. I was just wondering if there was any significance in using a for(;;) in particular.
What is the purpose of an empty for(;;) loop? Can not the exact same thing be accomplished with a while loop?
Actually, come to think of it, what's the use of a for loop anyway? After all, int i;
for (i = 0; i < 5; i++)
some_shit();
corresponds to int i = 0;
while (i < 5){
some_shit();
i++;
}
anyway?
Yes, a for(;;) is the same as while(1), but have you ever heard of such a thing as personal taste? I prefer a while(1) myself, but plenty of people prefer for(;;)IHBT
Name:
Anonymous2009-03-14 17:03
for(;;) is awesome because you can verbally read it as a "forever" loop.
Name:
Anonymous2009-03-14 17:04
>>7 Yes, a for(;;) is the same as while(1)
No, for(;;) avoids checking that 1 is true. (Some compilers are said to not optimize that away.)
>>4 while( counter < 3 ) for(;;) is primarily used for infinite loops.
Name:
Anonymous2009-03-14 17:08
(Some compilers are said to not optimize that away.)
Let me guess... GCC?
Name:
Anonymous2009-03-14 17:24
>>10
I don't think so. Hmm... I'll have to Google this for a while and run some tests.
Why is everyone in /prog/ a faggot? 20 posts and nobody explains what the acronym meant, meanwhile whining about /b/(the very reason this board has any users FYI).
IHBT= I have been trolled
YHBT= You have been trolled
HIBT= Have I been trolled?
etc.
It was assumed you know what this meant because this is a very common expression around /prog/. Since for some reason many people feel the need to troll up /prog/(probably since 4chan and /b/ are the troll hotspots of the internet). The majority of threads here are some form of obvious trolling/copypasta/spam. Even if the thread is legitimate, it quickly gets over-run by trolls and spammers who endlessly repeat stupid unfunny memes. Excuse my ranting, I just wish /prog/ didn't suck so much. Some light moderation and the removal of all but the "code" bbcode tag could quickly put an end to the worst of it and allow actual discussion.
>>22
Look, fuck you. The fact that you don't know how /prog/ works does not constitute a problem. Most of the actual programming discussion happens in the IRC channels we've spawned and that's fine. In the mean time, the rest of us would like to make sure our shibboleths are maintained so we can continue to have productive discussion in said channels.
>>22
While it is true that a number of us are /b/ expats, don't believe that we (the /b/ expats) appreciate it when other /b/tards come to spread their cancer. We don't care if this board's population stagnates or not. We care more for the segregation between the cancer and us.
>>28
People have been saying that for years and it's only ever been true twice. Now that FrozenVirgin is either gone or hiding, quality is back on the increase.