Well, no, he's both right and wrong, depending on what
definitions one uses. The function call/return mechanism in C
has properties of the abstract data structure called a stack.
This is true whether or not recursion is used. I hope we can all
agree on that.
There also is an architectural feature called a stack. This is a
contiguous area of storage with a pointer into it. It is used as
No, a stack is no such thing. It is an abstraction (T,S,R) where T is
a read write top, and a member of the set S (of which T is a member)
which has a successor rule or mechanism R that is known to exist but
about which we know nothing.
Alternatively take out R and change S from an unordered set to an
ordered n-tuple.
Contiguity be damned.
This is the Platonic Idea, and Herb's picture was the Aristotelean
model.
Schildt writes at the level of working people on whom programming
languages are more or less imposed and who cannot question work rules.
He gives no evidence of belief that a stack must have any one specific
layout as long as it meets the above abstract definition, whereas
highly educated people here (in the sense of certification) give
evidence of misunderstanding or dishonesty, because they present all
sorts of claptrap which turn out to support the above model.
Their fear is of contamination by hordes of ignorant Sophists in the
form of Microsoft programmers, who they imagine to be intrinsically
less educable than they.
There is a truth in this view. I've known people with 20 years of
experience of being intellectually brutalized in Microsoft "shops" who
don't know whether the right hand side of the Or in their language is
evaluated, or what (as we say in Chicago).
But (as Shakespeare knew) there is a Higher Brutalization.
Shakespeare, in Julius Caesar, shows a character, Brutus (where the
name was psychologically apt but not devised by Shakespeare) who
despite his "nobility" is a common thug. This was because Shakespeare
saw what happened to Marlowe, a scholarship student at Cambridge
(Corpus Christi).
Marlowe's education, as described by David Riggs in "The World of
Christopher Marlowe" was so competitive for scholarship students that
it soured Marlowe's personality and made him a thug as well as a
poet...whereas Shakespeare, with some life experience before coming to
London, was unique among playwrights known to us of his time:
Shakespeare was never busted for fighting.
In computer science, the Higher Brutalization is the fact that
computer science never solved the correctness problem, but instead
turned aside to make essentially incorrect software run fast in what
was essentially a boy's game. But Schildt's audience isn't interested
in high speed for its own sake: it wants to make its software work,
even as Shakespeare, rather than showing off how educated he was by
using too many Latin tags, wanted to make plays that could be staged.
a stack thusly: Items are pushed onto the stack by copying them
into the region beginning at the current stack pointer, followed
by moving the stack pointer. Items are popped by moving the
stack pointer to the beginning of where the item was loaded. (I
assume that everybody knows this but it's worth making sure that
we are all on the same page.)
Back in the early days people realized that hardware stacks
provided a simple and efficient way to implement function
call/return. Is it the only way to implement call/return. No.
In some circumstances it may not even be the most efficient way,
either for space or time.
Equivocation. Nobody here is saying that hardware stacks are needed to
run C.
The confusion begins when people jump back and forth between the
two concepts. Nilges has done this regularly, but he is scarcely
the only one.
No, I have nailed myself to the mast. A stack is an abstraction which
is best spoken of in words if you're teaching a data structures class,
since it IS possible that Little Darlings in data stuctures class
might confuse it as you do. Working people reading a computer book on
the other hand are in most cases able to distinguish a model from
reality, because they are lied to so regularly.
The other side of the coin is the insistence by some that "stack"
means an architectural feature.
AFAIK I never read one of Schildt's books so I can't comment on
their quality. However if I were writing a book I would be chary
about talking about "the stack". Given the duality of usage of
the term, doing so is likely to be a source of confusion.
Please don't write a book, then. Lemme tell you, it won't make you
rich.