miscon:programming.functions.recursion-as-loop · draft · trust low · v0.1.1 · kind misapplied-analogy
A recursive call jumps back to the start
A recursive call is a jump back to the beginning of the function, using the same variables, so there is only ever one copy of the function running.
- Stable URI
- https://open-misconceptions.github.io/miscon-data/m/programming.functions.recursion-as-loop
- UUID
fee3c932-6d7c-4816-aab9-c1dfe916ef15- Domain
programming.functions- Level band
- secondary, undergraduate
- Locale
- en
- About
- https://open-misconceptions.github.io/miscon-data/c/programming.functions.recursion (Miscon)
Evidence patterns
Pattern 0: trace a recursive function that does work after the recursive call
omits or misorders the work done after each call returns
def show(n):
if n == 0:
return
show(n - 1)
print(n)
show(3)1
2
33 2 1 (or nothing, or 1 only)Discriminators
vs a slip. Consistent across items with post-call work; the learner draws a single frame. A slip is a single ordering error.
vs programming.functions.base-case-not-needed. Base-case omitters are diagnosed by termination questions; loop-model holders by post-call ordering.
Relations
conflicts_with- Each recursive call has its own activation with its own variables (external)
resolved_by- Each recursive call has its own activation with its own variables (external)
confusable_withprogramming.functions.base-case-not-needed
Provenance
Origin: llm-drafted
- Kahney, H. (1983). What do novice programmers know about recursion? In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (CHI '83), 235-239. doi:10.1145/800045.801618
The 'looping' model of recursion. - Götschi, T., Sanders, I., & Galpin, V. (2003). Mental models of recursion. In Proceedings of the 34th SIGCSE Technical Symposium on Computer Science Education (SIGCSE '03), 346-350. doi:10.1145/611892.612004
Mental models of recursion including looping and active/passive-flow models.
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
fee3c932-6d7c-4816-aab9-c1dfe916ef15) - Source on GitHub
Cite
miscon:programming.functions.recursion-as-loop
https://open-misconceptions.github.io/miscon-data/m/programming.functions.recursion-as-loop