{
  "id": "programming.control.if-is-loop",
  "uri": "https://open-misconceptions.github.io/miscon-data/m/programming.control.if-is-loop",
  "uuid": "aa78ad26-c8b4-4d72-8e2f-84a48c0efed1",
  "version": "0.1.1",
  "status": "draft",
  "trust": "low",
  "title": "An if statement repeats while its condition holds",
  "statement": "The body of an if statement keeps running for as long as the condition is true, like a while loop.",
  "kind": "misapplied-analogy",
  "domain": "programming.control",
  "about": [
    {
      "scheme": "Miscon",
      "uri": "https://open-misconceptions.github.io/miscon-data/c/programming.control.conditional"
    }
  ],
  "level_band": [
    "secondary",
    "undergraduate"
  ],
  "locale": "en",
  "evidence_patterns": [
    {
      "item_shape": "trace an if statement whose body keeps its condition true",
      "signature": "predicts repeated execution of the body",
      "example": {
        "item": "x = 0\nif x < 3:\n    x = x + 1\nprint(x)",
        "expected": "1",
        "response": "3"
      }
    }
  ],
  "discriminators": {
    "vs_slip": "Consistent across items; the learner describes the if as 'checking until'. A slip is a single wrong count.",
    "vs": {
      "programming.control.while-checked-continuously": "That belief is about while loops exiting mid-body; this one is about if statements looping.",
      "programming.control.conditional-is-sequence": "Sequence believers run both branches once; if-loopers run one branch many times."
    }
  },
  "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.control.loop",
        "label": "A loop checks its condition only at defined points and repeats its whole body"
      }
    ],
    "confusable_with": [
      "programming.control.conditional-is-sequence",
      "programming.control.while-checked-continuously"
    ]
  },
  "alignments": [
    {
      "scheme": "progmiscon",
      "code": "Java/IfIsLoop",
      "uri": "https://progmiscon.org/misconceptions/Java/IfIsLoop",
      "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": "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"
      },
      {
        "type": "paper",
        "citation": "Sirkiä, T., & Sorva, J. (2012). Exploring programming misconceptions: An analysis of student mistakes in visual program simulation exercises. In Proceedings of the 12th Koli Calling International Conference on Computing Education Research, 19-28.",
        "doi": "10.1145/2401796.2401799"
      }
    ],
    "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"
}
