miscon:programming.strings.plus-adds-before-concatenating · draft · trust low · v0.1.1 · kind overgeneralization
Plus adds numbers before it concatenates
In an expression that mixes strings and numbers with +, the numbers are added together first and the string is attached afterwards.
- Stable URI
- https://open-misconceptions.github.io/miscon-data/m/programming.strings.plus-adds-before-concatenating
- UUID
71cc8015-8e64-4cbf-aec0-1227ef5023f9- Domain
programming.strings- Level band
- secondary, undergraduate
- Locale
- en
- About
- https://open-misconceptions.github.io/miscon-data/c/programming.strings.concatenation-order (Miscon)
Evidence patterns
Pattern 0: predict a left-to-right mixed concatenation
adds the numeric operands regardless of their position
Item
System.out.println("x" + 1 + 2);Expected
x12Response
x3Discriminators
vs a slip. Consistent across items; the learner explains that 'plus means add'. A slip is one wrong prediction.
Relations
conflicts_with- Operators of equal precedence apply left to right (external)
resolved_by- Operators of equal precedence apply left to right (external)
Alignments
- progmiscon Java/ArithmeticPlusPrecedes (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.
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
71cc8015-8e64-4cbf-aec0-1227ef5023f9) - Source on GitHub
Cite
miscon:programming.strings.plus-adds-before-concatenating
https://open-misconceptions.github.io/miscon-data/m/programming.strings.plus-adds-before-concatenating