Variable as a Parking Space

Programming Language

imperative / staticaly-typed

Form

Analogy

Attribution — Origin / Source

Collected by Jan Pearce — self-practice

Conceptual Advantage

Helps understanding of why types matter both in parking spaces and in statically-typed languages

Mapping

PLNM
variable parking space
value vehicle
type of variable vehicle size/shape/constraint on parking space
type of value type of vehicle

Draws Attention To

The idea of a statement, a condition, and how they are used to build sequence, selection, and repetition constructs of structured programming

Use When

When introducing typed variables

Cost

Very small

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