Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I actually like "for (;;) {}" as an idiom for an infinite loop (or at least, the terminating conditions are in the body rather than the loop construct itself.) It maybe stands out more than "while(true)", so readers can easily see what's going on. But maybe that's just a justification, and the real reason is that it looks clever because not everybody knows you can do that with a C-style for loop.


    #define ever (;;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: