User Tools

Site Tools


Week 5: Teaching Programming: Programming: Execution Flow, Variables, Memory


  • Identify a variety of languages/approaches used in a Pre-AP HS course
  • Discuss which languages would work well and why more than one should be used
  • Discuss different approaches and syllabi for Pre-AP course


  1. What do you think new students find difficult to understand when first learning about variables?
  2. Have you thought about variables having “roles” as described in Kuittinen (2004)? Do you think this concept would help students understand variables more easily? (Do you know about “painted types” and “Hungarian notation”?)
  3. In what ways do students confuse (“conflate”) objects and classes? Objects and variables?
  4. How could you explain the C++ string method “swap”?


  • What are good introductory programming languages? (Brainstorm a list)
  • What are the benefits of each language?
  • Are there certain topics/concepts when a certain language should be used?
  • Review different syllabi/course outlines for Pre-AP courses
  • Allow preservice teachers to demonstrate how to teach their future students understanding and skill in the use of variables and assignment of values to variables, as follows:
    • differentiate between variables and values
    • identify primitive types of variables
    • identify the characteristics of the different types of variables and the operators appropriate to the different types
    • explain conventions for naming variables
    • Identify an acceptable program statement that assigns a value to a variable
    • explain how a variable assignment is executed
    • What misconceptions K-12 students might have about variable and values
    • A concrete model is useful to demonstrate how a value is assigned to a variable.
    • A “RAM mailbox” structure with several compartments is an excellent model. Objects representing information can be moved among the compartments to show how values are assigned and moved. References to the mailbox are useful for more advanced topics such as traces, arrays, and sorts.
    • Role playing can be a good experience with students representing memory locations and data.

It is important that students understand the difference between numeric and string variables and the way they are handled in the language. An activity early in the course to help students learn the differences can prevent grief later in the course for them. An assignment where students correct variable mismatches or write a program with mismatches for a classmate to correct would be valuable.

Readings for Class Discussion

  • Holland, S., Griffiths, R., & Woodman, M. (1997). Avoiding object misconceptions. ACM SIGCSE Bulletin, 29(1), 131-134
  • Kuittinen, M., & Sajaniemi, J. (2004). Teaching roles of variables in elementary programming courses. In Proceedings of the 9th annual SIGCSE conference on Innovation and technology in computer science education (p. 61). ACM.


  • Teaching Conditionals/Loops
  • Preparation for classroom visits
mt2011/week5.txt · Last modified: 2011/03/06 20:45 by Tim Korb