miscon:programming.control.conditional-is-sequence · draft · trust low · v0.1.1 · kind overgeneralization

Both branches of an if-else run in turn

In an if-else statement the if branch runs when the condition is true and then the else branch runs afterwards as well, because it comes next in the code.

Stable URI
https://open-misconceptions.github.io/miscon-data/m/programming.control.conditional-is-sequence
UUID
7e5b6c85-5df3-4013-8746-0f18576e8b5a
Domain
programming.control
Level band
primary, middle, secondary, undergraduate
Locale
en
About
https://open-misconceptions.github.io/miscon-data/c/programming.control.conditional (Miscon)

Evidence patterns

Pattern 0: trace an if-else where the condition is true

reports the effects of both branches

Itemx = 5 if x > 0: print('positive') else: print('not positive')
Expectedpositive
Responsepositive not positive

Discriminators

vs a slip. Consistent across items and the learner explains 'it does this one and then that one'. A slip is a single wrong branch.

vs programming.control.if-is-loop. If-loopers repeat one branch; sequence believers run both once.

Relations

conflicts_with
An if statement evaluates its condition once and runs at most one branch (external)
resolved_by
An if statement evaluates its condition once and runs at most one branch (external)
Statements run one at a time in order (external)
confusable_with
programming.control.if-is-loop

Alignments

Provenance

Origin: llm-drafted

  1. 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
    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.
  2. Swidan, A., Hermans, F., & Smit, M. (2018). Programming misconceptions for school students. In Proceedings of the 2018 ACM Conference on International Computing Education Research (ICER '18), 151-159. doi:10.1145/3230977.3230995
    Scratch learners treating if-then-else as sequential blocks.
  3. Sorva, J. (2012). Visual Program Simulation in Introductory Programming Education (Doctoral dissertation, Aalto University). Appendix A catalogues introductory programming misconceptions from the literature. link

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

Cite

miscon:programming.control.conditional-is-sequence
https://open-misconceptions.github.io/miscon-data/m/programming.control.conditional-is-sequence