{
  "id": "programming.control.conditional-is-sequence",
  "uri": "https://open-misconceptions.github.io/miscon-data/m/programming.control.conditional-is-sequence",
  "uuid": "7e5b6c85-5df3-4013-8746-0f18576e8b5a",
  "version": "0.1.1",
  "status": "draft",
  "trust": "low",
  "title": "Both branches of an if-else run in turn",
  "statement": "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.",
  "kind": "overgeneralization",
  "domain": "programming.control",
  "about": [
    {
      "scheme": "Miscon",
      "uri": "https://open-misconceptions.github.io/miscon-data/c/programming.control.conditional"
    }
  ],
  "level_band": [
    "primary",
    "middle",
    "secondary",
    "undergraduate"
  ],
  "locale": "en",
  "evidence_patterns": [
    {
      "item_shape": "trace an if-else where the condition is true",
      "signature": "reports the effects of both branches",
      "example": {
        "item": "x = 5\nif x > 0:\n    print('positive')\nelse:\n    print('not positive')",
        "expected": "positive",
        "response": "positive\nnot positive"
      }
    }
  ],
  "discriminators": {
    "vs_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": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.control.conditional",
        "label": "An if statement evaluates its condition once and runs at most one branch"
      }
    ],
    "resolved_by": [
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.control.conditional",
        "label": "An if statement evaluates its condition once and runs at most one branch"
      },
      {
        "external": "https://open-misconceptions.github.io/miscon-data/c/programming.execution.sequential-execution",
        "label": "Statements run one at a time in order"
      }
    ],
    "confusable_with": [
      "programming.control.if-is-loop"
    ]
  },
  "alignments": [
    {
      "scheme": "progmiscon",
      "code": "Java/ConditionalIsSequence",
      "uri": "https://progmiscon.org/misconceptions/Java/ConditionalIsSequence",
      "relation": "close-match"
    },
    {
      "scheme": "progmiscon",
      "code": "Scratch/ConditionalIsSequence",
      "uri": "https://progmiscon.org/misconceptions/Scratch/ConditionalIsSequence",
      "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": "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",
        "note": "Scratch learners treating if-then-else as sequential blocks."
      },
      {
        "type": "book",
        "citation": "Sorva, J. (2012). Visual Program Simulation in Introductory Programming Education (Doctoral dissertation, Aalto University). Appendix A catalogues introductory programming misconceptions from the literature.",
        "url": "https://aaltodoc.aalto.fi/handle/123456789/3534"
      }
    ],
    "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"
}
