Stay if ...



You write a lot of for loops


You don't have a television

That's for loops that rumble over collections.

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

So I'm here to talk about iterators, in general. Most of the code I'm going to show is in Java, but that's mainly a pedagogic device, and pretty much everything we're going to look can be applied generally - .NET enumerators, Python iterators and list comprehensions, in a slightly different form to C++ and so on. Don't get hung up on the syntax.

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