{
  "id": "programming.objects.assignment-copies-object",
  "uri": "https://open-misconceptions.github.io/miscon-data/m/programming.objects.assignment-copies-object",
  "uuid": "bf369c82-773c-4072-950c-55b6d9464684",
  "version": "0.1.1",
  "status": "draft",
  "trust": "low",
  "title": "Assigning an object makes a copy",
  "statement": "Assigning one object variable to another makes a second, independent copy of the object, so changing one does not affect the other.",
  "kind": "overgeneralization",
  "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": "trace a mutation through an aliased object",
      "signature": "reports the other variable's object as unchanged",
      "example": {
        "item": "a = [1, 2]\nb = a\nb.append(3)\nprint(a)",
        "expected": "[1, 2, 3]",
        "response": "[1, 2]"
      }
    }
  ],
  "discriminators": {
    "vs_slip": "Consistent across items with mutable objects, and the learner is surprised by the result. A slip is a single wrong trace.",
    "vs": {
      "programming.objects.variables-hold-objects": "Same observable error; variables-hold-objects is the underlying model (the variable is the object). Ask the learner to draw a and b: two boxes with contents versus two arrows to one object.",
      "programming.variables.assignment-links-variables": "The primitive mirror image. Test with an int item and a list item."
    }
  },
  "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.variables-hold-objects"
    ]
  },
  "alignments": [
    {
      "scheme": "progmiscon",
      "code": "Java/AssignmentCopiesObject",
      "uri": "https://progmiscon.org/misconceptions/Java/AssignmentCopiesObject",
      "relation": "close-match"
    },
    {
      "scheme": "progmiscon",
      "code": "Python/AssignmentCopiesObject",
      "uri": "https://progmiscon.org/misconceptions/Python/AssignmentCopiesObject",
      "relation": "close-match"
    },
    {
      "scheme": "progmiscon",
      "code": "JavaScript/AssignmentCopiesObject",
      "uri": "https://progmiscon.org/misconceptions/JavaScript/AssignmentCopiesObject",
      "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": "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",
        "note": "Non-viable models of reference assignment."
      },
      {
        "type": "paper",
        "citation": "Holland, S., Griffiths, R., & Woodman, M. (1997). Avoiding object misconceptions. In Proceedings of the 28th SIGCSE Technical Symposium on Computer Science Education (SIGCSE '97), 131-134.",
        "doi": "10.1145/268084.268132"
      }
    ],
    "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"
}
