5

We currently have tags for:

  • with 262 questions and a tag wiki excerpt of

In computer programming, an iterator is an object that enables a programmer to traverse a container.

  • with 243 questions and a tag wiki excerpt of

A sequence of instructions that repeats either a specified number of times or until a particular condition is met

  • with 86 questions and no tag wiki excerpt

Are all needed and, if synonymy is proposed, which should be the master?

  • Both tags are mostly associated with esri products. Look at the top users page. – Andre Silva Jan 15 at 23:04
  • @AndreSilva I've expanded this question to take in the loop tag too. – PolyGeo Jan 16 at 3:29
  • 1
    Personally I would use Loop when referring to code and Iterator specifically for ArcGIS Model Builder. In that sense I'd view them differently, but overall they're pretty much the same thing – Midavalo Jan 16 at 20:17
  • 1
    An iteration is a form of a loop but a loop need not have an iterator... various programming/scripting languages have forms of while condition do or do until condition loops (even the derided GOTO: loops if you look hard enough) which have no iteration so I believe that loop is different to iterator/iteration, of which there should only be one but am fairly ambivalent as to which as one is the object the other is the action. – Michael Stimson Jan 18 at 4:32
  • An iterator is also a python object, so not specifically Esri. wiki.python.org/moin/Iterator – user2856 Jan 18 at 7:10
  • ...and a Javascript concept: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… – Stefan Jan 18 at 13:52
  • Iterator and iteration are synonyms in my opinion. In SO, loop and iterator are not synonyms. Some comments explained differences between them, but none addressed how these two tags are used in GIS SE. @MichaelStimson you commented a loop needs an iterator, and then, said about forms of loops which do not have iteration. – Andre Silva Jan 18 at 16:55
3

Loop and iteration are not synonyms (an iteration is one single step of a loop), but they refer to the same process, so I suggest to use a single tag. I prefer which has been used 243 times against the 86 times for .

From a programming perspective, iterator and iteration are different. Iterators are specific objects to go through a container, available in many object-oriented languages. Definition below from C++ iterator

An iterator is any object that, pointing to some element in a range of elements (such as an array or a container), has the ability to iterate through the elements of that range using a set of operators (with at least the increment (++) and dereference (*) operators).

These iterators can be used to loop inside a container, but many loop do not require an iterator (example: while loops).

On the other hand, the term "iterator" is used by ESRI for their ModelBuilder tools (cfr list of iterators in ESRI doc):

Iterators enable batch processing and help repeat a process or set of processes on a set of inputs.

A flag "iterator" can therefore be confusing because it refers to two different concepts, but I don't expect many "pointer" related questions in GIS SE (specific "pointer" questions will probably be out of scope, in my humble opinion).

I've looked at the first 50 questions flagged with . All but 4 were ArcGIS-related, and only one was really about a pointer but would have been perfectly understood with a flag like or . Based on its use, we can say that

"iterator" is a combination of   "modelbuilder" + "loop/iteration". 

To sum up: merge and .

could be merged with , but it is more specific. If and are used together, then it is unambiguously associated with . However, "loop" and "arcgis" is not sufficient, because there can be loops in arcpy, and they don't use ESRI's iterators.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .