Abstract
In the first three chapters, we embark on a practical study of computation. Our goal is to develop and understand a simple but expressive model of computation that will underlie the material in the remainder of this book—and on which you can subsequently draw when learning more advanced programming skills and concepts. In the first chapter, we introduce memory; in the second, procedure. In the third, we combine memory and procedure to study two basic data structures.
Whereas a traditional programming course reserves “pointers” for late in the semester and may not even mention the stack, let alone how function calling works, this chapter covers both—for two reasons. First, manipulating memory is fundamental to practical programming, yet many students, through lack of practice, leave their first programming course unable to do so effectively. By introducing memory manipulation in the first week, students have a full semester to master the topic. Second, the correct usage of call-by-value, call-by-reference, pointers, and arrays is crucial for writing anything but the simplest of programs. Rather than taking an abstract and rule-based perspective, this chapter covers the program stack and the function call protocol, which naturally give rise to these concepts. A mechanistic understanding of computation lays the foundations for the powerful abstraction methodologies that come later.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Bradley, A.R. (2011). Memory: The Stack. In: Programming for Engineers. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-23303-6_1
Download citation
DOI: https://doi.org/10.1007/978-3-642-23303-6_1
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-23302-9
Online ISBN: 978-3-642-23303-6
eBook Packages: Computer ScienceComputer Science (R0)