The queue is one of the fundamental data structures. It is a FIFO (first in, first out), where items are appended to one end and extracted from the other. The two ends are commonly labelled
tail, but which end is which? It depends on your metaphor.
If your queue is a list, then you will append at the
tail and extract from the
head. But if your queue is a beast, then you feed the
head and excrete from the
So which be it, list or beast?
This seems to be one of those questions for which there is not a sufficiently right answer, so opinions are sharply divided. So my thought was to appeal to a higher authority, who in this case would have to be Donald Knuth. But Volume One of The Art of Computer Programming does not use
tail in describing queues.
Knuth has published a program called Simpath that does implement a queue using
tail, but the commentary does not describe the metaphor. An examination of the code shows that he uses the beast model, and he just assumes that the reader knows that. That is an interesting data point, but it is not the definitive authority I was looking for.
So this is where it settles out for me: I want to disambiguate so that it is obvious which end is which. The terms
tail are provably ambiguous and confusing, so they should not be used regardless of the metaphor.
If your model is list, then use
back. You read from the
front and you write to the
If your model is beast, then use
anus. It just makes sense.