Given the academic definition of a Stack as "A data structure where items are added in a FILO manner and accessed in such a way that only the top item may be examined or removed to be modified."
Game view implementations that call them "stacks" where each view is pushed
onto the top or popped
off the top and each view below it is visible seems to violate the above definition. The first part is valid, views are only added/removed from the top but the fact that each other view in the stack is still visible from top-down seems to violate the principle that only the top is accessible for examination or modification.
That said, are these implementations actually Stacks in the data structure sense of the word or just wrapped fully accessible arrays with fancy methods called pop
and push
added to them?