Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Why are "push", "pop", "shift" and "unshift" so named?

by herby1620 (Monk)
on May 02, 2007 at 20:13 UTC ( #613250=note: print w/replies, xml ) Need Help??


in reply to Why are "push", "pop", "shift" and "unshift" so named?

While it seems that "push" and "pop" are already in the dictionary of computer terms, my preference is to use "push" and "pull". One computer I worked on had these terms and it was easy to understand (besides they were both 4 letter words). The current terms appear to have been popularized from pdp-10 (-6) usage, as that is how DEC documented them. The "dish stack" in a cafeteria that was spring loaded, usually had two stacks of dishes (the device was about 12 inches by 24 inches and had rollers). In addition the stacker could have been plugged in to heat the plates to a reasonable (non-burning) temperature (why they had two stacks). Nowdays some pharmacy's have spring loaded displays for box packaged things. Unfortunately these don't rotate the stock too well, so if the stock becomes close to depleted, you might get stale product. The whole analogy is to appear to have only ONE item visible to the "consumer".

Stacks as implemented in computer hardware work in various ways. I've seen them grow by increasing addresses, and by decreasing addresses (big-endian/little-endian). Since they rarely diverge from the host hardware, it makes little difference. As far as things go, devices like "stacks", "queues", and "lists" are pretty general, and typically the subject of a first course in programming. What to call the "operators" on these devices is what one might call a "local option". They do vary, but there are a few common names.

  • Comment on Re: Why are "push", "pop", "shift" and "unshift" so named?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://613250]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2019-11-13 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (67 votes). Check out past polls.

    Notices?