|
|
|
|
|
by andybak
3699 days ago
|
|
With regard to C-style for loops - other than familiarity - why? It always struck me as a fairly warty syntax. Consider Python where you usually do: for item in iterator
If you want an integer sequence it's: for integer in range(1, 100)
and for those rare occurrences where you need an integer index as well: for index, item in enumerate(iterator)
Swift seems to have a similar approach. Why would you ever want the C-style iterators? |
|