Misconception: Students believe that in a primitive assignment, x = y could be the equivalent of y = x; they think that the computer science “=” sign is the same as the mathematical “=” sign.

Like(1923 Likes)
  • These misconceptions are the result of an incorrect mental model of how variable assignment works. To learn more about these misconceptions and why they arise, watch Mark Guzdial's CS Education Zoo interview
  • Ask students about the difference between the assignment statement = and the mathematical =. Make sure to explain to students that = in an assignment statement can be read as “is set to the value of” and should be called the assignment operator
  • You want students to reflect their knowledge by saying: the left hand side is a variable that you can assign a value to, and the right hand side is an expression or value that can be stored by that variable.