Stay if ...



You write a lot of for loops


That's for loops that rumble over collections.

Can I take the temperature? Java programmers? Just Java, or other things? What other things?

I'm here to talk about iterators, specifically Iterators as found in the Java standard library. Probably everything I'm going to say could also be applied to .NET enumerators. I suspect it could also be applied to Python list comprehensions, but I haven't really tried and you might have to write your Python in a "funny way". It can be/is already applied, in a slightly different form to C++ iterators, but don't let the necessarily put you off.

As we go through the for loop count will probably go up a bit, then hopefully down again.

So I'm here to talk about iterators. What is an iterator?