The "queue", or FIFO, is one of the most common data structures, and have native implementations in many languages and frameworks. However, there seems to be little consensus as to how fundamental queue operations should be named. A survey of several popular languages show:
- Python: put / get
- C#, Qt : enqueue /dequeue
- Ruby, C++ STD: push / pop
- Java: add / remove
If one need to implement a queue (say, in some embedded platform that does not have a native queue implementation already), what naming convention would be best? Enqueue/dequeue seem to be the most explicit, but is wordy; put/get is succinct but does not provide any hint as to the FIFO nature of the operations; push/pop seems to be suggest stack operations instead of queue operations.