The terminology is really language-bound and becomes quite confusing.
In C ++, "enumerat ion " ( enum ) is a name , which means "a bunch of numbered elements", so no action happens; it is just a thing (e.g. class ).
And, of course, "iterat ion " refers to an action that means "repeat the action many times." Often this is accompanied by a list of items.
But in some languages, each has a certain meaning as an action:
C #: Enumerators are objects that go through the elements of a collection (e.g. C ++ iterators; IEnumerator<T> ). Iterators are methods that do almost the same thing, but in the style of coroutine ( yield return ).
C # still has enumerat ion s ( enum s), as in C ++.
Java: Iterators go through the elements of a collection, as in C ++. I'm not sure about the "counters".
Java still has a counter similar to C ++, but they are also different.
Python: Iterators are similar to C # enumerations; generators are similar to C # iterators ( yield ).
No enumerated ions, AFAIK.
and etc.
source share