miscon:programming.functions.argument-name-must-match-parameter · draft · trust low · v0.1.1 · kind misapplied-analogy
Arguments are matched to parameters by name
The variable passed to a function has to have the same name as the parameter, or the function will not receive it.
- Stable URI
- https://open-misconceptions.github.io/miscon-data/m/programming.functions.argument-name-must-match-parameter
- UUID
e7df53b7-374a-4b33-86e9-3c2883c5374f- Domain
programming.functions- Level band
- secondary, undergraduate
- Locale
- en
- About
- https://open-misconceptions.github.io/miscon-data/c/programming.functions.parameter-passing (Miscon)
Evidence patterns
Pattern 0: predict the output of a call whose argument name differs from the parameter name
predicts an error or that the parameter is unset
def show(n):
print(n)
value = 5
show(value)5Error: n is not defined (or 'nothing')Pattern 1: write a call to a given function
renames the local variable to match the parameter before calling
Given def area(width, height), compute the area of a rectangle whose sides are stored in w and h.area(w, h)width = w
height = h
area(width, height)Discriminators
vs a slip. Consistent renaming or predicted errors across items. A slip is a single wrong name.
vs programming.functions.parameters-alias-arguments. Aliasers accept different names but expect changes to the parameter to flow back; name-matchers do not accept different names at all.
Relations
conflicts_with- Arguments are matched to parameters by position and copied in (external)
resolved_by- Arguments are matched to parameters by position and copied in (external)
confusable_withprogramming.functions.parameters-alias-arguments
Provenance
Origin: llm-drafted
- 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
Student-constructed rules for parameter passing. - 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
- Qian, Y., & Lehman, J. (2017). Students' misconceptions and other difficulties in introductory programming: A literature review. ACM Transactions on Computing Education, 18(1), Article 1. doi:10.1145/3077618
Drafted from the cited literature for the Open Misconceptions seed pack; statement, examples and discriminators are original text. Awaiting maintainer review.
Review status
Status draft, trust low (computed from the reviews below against the reviewer registry).
No reviews yet.
Formats
- Raw JSON
- CASE 1.1 package (CFItem
e7df53b7-374a-4b33-86e9-3c2883c5374f) - Source on GitHub
Cite
miscon:programming.functions.argument-name-must-match-parameter
https://open-misconceptions.github.io/miscon-data/m/programming.functions.argument-name-must-match-parameter