I have written one simple Android Tetris application. After it I decided to read the dev tutorial. It is time to start.
So, reading about Back Stack
, I was surprised to find this in the tutor开发者_如何转开发ial:
The back stack abides to the basic "last in, first out" queue mechanism
"Last in and first out" and "queue" I am fully confident these are different things, I mean "stack" and "queue". Is it a mistake in the tutorial or did the writer want to say something else?
Besides the obvious possibilities in the Queue being double-ended, I think it's just a (perhaps intentional) mix of English and Programming lingo in that sentence.
When I read that sentence:
The back stack abides to the basic "last in, first out" queue mechanism
I understand the "queue mechanism" in plain English, not programming, as in the definition given by the Merriam-Webster's (See #3)
Of course, that makes me think that document was proof-read by a non-technical fellow :)
A stack can be seen as a special form of a queue, a LIFO queue. While a queue is usually associated with FIFO (first in, first out) behavior both data structures are often implemented on top of a double ended queue which supports both operating modes.
精彩评论