{
  "id": "programming.objects.variables-hold-objects",
  "uri": "https://open-misconceptions.github.io/miscon-data/m/programming.objects.variables-hold-objects",
  "uuid": "d4a1fd15-44b9-4752-b086-b9a07a1e7ae7",
  "version": "0.1.1",
  "status": "draft",
  "trust": "low",
  "title": "A variable contains the whole object",
  "statement": "An object variable contains the object itself, not a reference to it, so every variable is its own object and passing it around passes the object.",
  "kind": "misapplied-analogy",
  "domain": "programming.objects",
  "about": [
    {
      "scheme": "Miscon",
      "uri": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.reference"
    }
  ],
  "level_band": [
    "secondary",
    "undergraduate"
  ],
  "locale": "en",
  "evidence_patterns": [
    {
      "item_shape": "draw or describe memory after two variables refer to one object",
      "signature": "draws two separate objects, one inside each variable",
      "example": {
        "item": "p = Point(1, 2)\nq = p\nDraw p and q.",
        "expected": "Two variables, both pointing to one Point object",
        "response": "Two boxes, each containing a Point(1, 2)"
      }
    },
    {
      "item_shape": "predict identity comparison of two variables assigned from one another",
      "signature": "predicts they are different objects",
      "example": {
        "item": "p = Point(1, 2)\nq = p\nprint(p is q)",
        "expected": "True",
        "response": "False"
      }
    }
  ],
  "discriminators": {
    "vs_slip": "Diagnosed by the drawing or by identity questions; the model is consistent. A slip is a single wrong prediction with a correct drawing.",
    "vs": {
      "programming.objects.assignment-copies-object": "Assignment-copies is the behavioural prediction; this record is the memory model behind it. Use the drawing task to separate learners who know about references but think assignment copies from those with no reference concept."
    }
  },
  "relations": {
    "conflicts_with": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.reference",
        "label": "An object variable holds a reference; assignment copies the reference"
      }
    ],
    "resolved_by": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.objects.reference",
        "label": "An object variable holds a reference; assignment copies the reference"
      }
    ],
    "confusable_with": [
      "programming.objects.assignment-copies-object",
      "programming.objects.equality-compares-contents"
    ]
  },
  "alignments": [
    {
      "scheme": "progmiscon",
      "code": "Python/VariablesHoldObjects",
      "uri": "https://progmiscon.org/misconceptions/Python/VariablesHoldObjects",
      "relation": "close-match"
    }
  ],
  "provenance": {
    "sources": [
      {
        "type": "inventory",
        "citation": "Chiodini, L., Moreno Santos, I., Gallidabino, A., Tafliovich, A., Santos, A. L., & Hauswirth, M. (2021). A curated inventory of programming language misconceptions. In Proceedings of the 26th ACM Conference on Innovation and Technology in Computer Science Education (ITiCSE '21), 380-386.",
        "doi": "10.1145/3430665.3456343",
        "url": "https://progmiscon.org/",
        "note": "Inventory consulted for the misconception name and scope only; progmiscon publishes no licence for its text, so Open Misconceptions' statements and examples are written independently."
      },
      {
        "type": "paper",
        "citation": "Sorva, J. (2013). Notional machines and introductory programming education. ACM Transactions on Computing Education, 13(2), Article 8.",
        "doi": "10.1145/2483710.2483713",
        "note": "Notional machine: references versus values."
      },
      {
        "type": "paper",
        "citation": "Ma, L., Ferguson, J., Roper, M., & Wood, M. (2007). Investigating the viability of mental models held by novice programmers. In Proceedings of the 38th SIGCSE Technical Symposium on Computer Science Education (SIGCSE '07), 499-503.",
        "doi": "10.1145/1227310.1227481"
      }
    ],
    "origin": "llm-drafted",
    "notes": "Drafted from the cited literature for the Open Misconceptions seed pack; statement, examples and discriminators are original text. Awaiting maintainer review."
  },
  "history": {
    "changelog": [
      {
        "version": "0.1.1",
        "date": "2026-09-05",
        "change": "Schema 0.2 migration: about/alignments carry a free-string scheme (corestandards.org URLs relabelled CCSS where present); trust computed from reviews[] (none yet, so low); no change to the statement or evidence."
      }
    ]
  },
  "license": "CC-BY-4.0"
}
