logoalt Hacker News

thaumasiotestoday at 2:48 PM0 repliesview on HN

> It's not like 'for' is limited to counting in other languages. The grand-daddy in c does something until some condition is false

C 'for' is a while loop. It's strictly syntactic sugar for an already existing feature. And it's really, really transparent. `for(A; B; C) { do_stuff(); }` isn't just a while loop, it's this while loop:

    A;
    while(B) {
      do_stuff();
      C;
    }
Other languages have treated for as a separate concept from while. C isn't really informative in that case.