| ▲ | Joker_vD a day ago | |
That's the price of innovation, I guess; before C invented its "for"-loop, other languages had their equivalents generally looking like this:
No custom increment expressions, and "step" even usually was only allowed to be a constant (in which case, the language usually didn't have DOWN specifier and used the step's sign instead). Then Dennis Ritchie invented C, and ditched the traditional "do"-loop (Fortran started that construct with DO, so it was called DO loop; Algol used FOR instead, but most people preferred the Fortran's nomenclature... until C came to dominate, but that wouldn't happen for yet another 20 years) in favour of his invention because he felt that easily iterating through linked lists or strings was a much more pressing concern:
The downside, of course, is that now you can't straightforwardly write | ||
| ▲ | 21 hours ago | parent [-] | |
| [deleted] | ||