Array Elements as Students

Programming Language

imperative / any

Form

Analogy

Attribution — Origin / Source

Collected by Craig S. Miller — Interview, John Lynch

Conceptual Advantage

Creates memorable live demonstration of indexed list elements in order to distinguish between index and value. Also useful to demonstrate out-of-bound errors.

Mapping

PLNM
array row of students
array element student (standing in a row)
element index relative position of the student, start with 0
element value nationality of student

Draws Attention To

Array/list indices and the values at those locations.

Use When

To distinguish between an element value and its index.

Cost

not captured

Comments or Feedback?

Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.

For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".

Create an Issue on GitHub