miscon:programming.arrays.length-is-a-method · draft · trust low · v0.1.1 · kind notation-confusion

An array's length is a method call

You get the length of an array by calling a method on it, in the same way as for a string or a list.

Stable URI
https://open-misconceptions.github.io/miscon-data/m/programming.arrays.length-is-a-method
UUID
38f22ed3-8b31-4032-9be3-581599629ee5
Domain
programming.arrays
Level band
secondary, undergraduate
Locale
en
About
https://open-misconceptions.github.io/miscon-data/c/programming.arrays.length (Miscon)

Evidence patterns

Pattern 0: write the length of an array

writes length() or size() on an array

ItemGiven int[] a, write an expression for its length.
Expecteda.length
Responsea.length() (or a.size())

Discriminators

vs a slip. A slip is a typo fixed on the first compile error. The belief persists across items and the learner explains that 'everything is a method'.

Relations

conflicts_with
An array's length is a property, not a method (external)
resolved_by
An array's length is a property, not a method (external)

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.

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.arrays.length-is-a-method
https://open-misconceptions.github.io/miscon-data/m/programming.arrays.length-is-a-method