miscon:programming.booleans.no-short-circuit · draft · trust low · v0.1.1 · kind undergeneralization
Both operands of and/or are always evaluated
A logical and or or always evaluates both of its operands, whatever the first one turns out to be.
- Stable URI
- https://open-misconceptions.github.io/miscon-data/m/programming.booleans.no-short-circuit
- UUID
835a754e-f33f-4ab3-88a1-2cc87dc58918- Domain
programming.boolean- Level band
- secondary, undergraduate
- Locale
- en
- About
- https://open-misconceptions.github.io/miscon-data/c/programming.booleans.short-circuit (Miscon)
Evidence patterns
Pattern 0: predict whether a guarded expression raises an error
predicts an error from the second operand even though the first operand decides the result
items = []
if len(items) > 0 and items[0] == 'x':
print('yes')
else:
print('no')noIndexErrorPattern 1: predict a side effect in the second operand
predicts the side effect happens when the first operand already decides the result
def f():
print('called')
return True
result = False and f()(nothing printed)calledDiscriminators
vs a slip. Consistent across items; the learner can state 'it checks both'. A slip is a single wrong prediction.
Relations
conflicts_with- Logical and/or stop evaluating once the result is known (external)
resolved_by- Logical and/or stop evaluating once the result is known (external)
Alignments
- progmiscon Java/NoShortCircuit (close-match)
- progmiscon Python/NoShortCircuit (close-match)
Provenance
Origin: llm-drafted
- 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. - 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
835a754e-f33f-4ab3-88a1-2cc87dc58918) - Source on GitHub
Cite
miscon:programming.booleans.no-short-circuit
https://open-misconceptions.github.io/miscon-data/m/programming.booleans.no-short-circuit