3 ms·
> Iterators have largely replaced the explicit specification of integer ranges in loop control. I'd agree with that for lots of domains. If you're dealing with
by seanwilson 10y ago
> Iterators have largely replaced the explicit specification of integer ranges in loop control.
I'd agree with that for lots of domains. If you're dealing with indices often you're probably working at the wrong level of abstraction. Indices are just error prone in general even if you count from zero.
- jimmaswell 10y agoWhat if the index has some meaning to my calculations? What if I'm indexing parallel arrays? These both happen all the time in my python scripts.
- seanwilson 10y agoI said "for lots of domains". Obviously you have to use indices in some code but if it's possible to avoid using indices it's usually a good idea (e.g. using iterators over a standard for loop).