{
  "id": "programming.functions.parameters-alias-arguments",
  "uri": "https://open-misconceptions.github.io/miscon-data/m/programming.functions.parameters-alias-arguments",
  "uuid": "7e500e88-daa7-49cb-a8f4-d0e0d6a62db0",
  "version": "0.1.1",
  "status": "draft",
  "trust": "low",
  "title": "Changing a parameter changes the caller's variable",
  "statement": "A parameter is the same variable as the argument that was passed in, so assigning to the parameter inside the function changes the caller's variable, even for numbers and strings.",
  "kind": "overgeneralization",
  "domain": "programming.functions",
  "about": [
    {
      "scheme": "Miscon",
      "uri": "https://open-misconceptions.github.io/miscon-data/c/programming.functions.parameter-passing"
    }
  ],
  "level_band": [
    "secondary",
    "undergraduate"
  ],
  "locale": "en",
  "evidence_patterns": [
    {
      "item_shape": "trace a function that reassigns a primitive parameter",
      "signature": "reports the caller's variable as changed",
      "example": {
        "item": "def bump(n):\n    n = n + 1\nx = 1\nbump(x)\nprint(x)",
        "expected": "1",
        "response": "2"
      }
    }
  ],
  "discriminators": {
    "vs_slip": "Consistent across items with primitive arguments. A slip is a single wrong trace.",
    "vs": {
      "programming.functions.argument-name-must-match-parameter": "Name-matchers predict errors when names differ; aliasers accept different names.",
      "programming.objects.assignment-copies-object": "The mirror: aliasers expect sharing where there is none; object-copiers expect independence where there is sharing. Test with a primitive item and a mutable-object item."
    }
  },
  "relations": {
    "conflicts_with": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.functions.parameter-passing",
        "label": "Arguments are matched to parameters by position and copied in"
      }
    ],
    "resolved_by": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.functions.parameter-passing",
        "label": "Arguments are matched to parameters by position and copied in"
      },
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.variables.assignment",
        "label": "Assignment copies a value into a variable at one moment"
      }
    ],
    "confusable_with": [
      "programming.functions.argument-name-must-match-parameter"
    ]
  },
  "provenance": {
    "sources": [
      {
        "type": "paper",
        "citation": "Fleury, A. E. (1991). Parameter passing: The rules the students construct. In Proceedings of the 22nd SIGCSE Technical Symposium on Computer Science Education (SIGCSE '91), 283-286.",
        "doi": "10.1145/107004.107066"
      },
      {
        "type": "paper",
        "citation": "Madison, S., & Gifford, J. (2002). Modular programming: Novice misconceptions. Journal of Research on Technology in Education, 34(3), 217-229.",
        "doi": "10.1080/15391523.2002.10782346"
      },
      {
        "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"
}
