Re:Khan Academy: Computer Science
by loup-vaillant on Wednesday November 02, 2011 @04:54AM
(#3185880)
I note that the biggest mistake probably comes from C itself. If only it had chosen for assignment a syntax such as :
x <- 5;
It would be more clear that "the shit on the right" goes to that garbage on the left. But no, they had to use the `=` sign, as if saving one character where more important than not changing the meaning of one of the most used sign of all mathematics. And now nearly all popular language is making the same damn mistake.The only thing I liked about PL/SQL back in the day was its use of := for assignment and = for equivalence.
I pronounce "==" as "equalsequals", sort of slurring the two words together for speed, so they sound like all one word. This is consistent with the way I treat the bitwise-versus-boolean operator confusion, e.g. "&" is "and" while "&&" is "andand".
I agree with your main point, though, that failure to understand assignment is one of the biggest failure points for beginners. What programmers need to be able to do is trace through the execution of a program in their head, thinking "once this statement executes, the state will change in so-and-such way."
If I had to teach introductory programming again, I would focus more on having people fiddle around with variables in a REPL, just to get a feel for that sort of thing.
Not correctly understanding assignment is one of the biggest failure points for beginners learning programming. The '=' operator has little relation to '=' in any form the students have encountered before. It means something like "evaluate the shit on the right hand side, and store it in a variable with the name on the left hand side". That meaning is not really even close to the meaning of the english word "equals".
You can personally call it whatever you want, but if you want to be a good teacher to beginning programmers, then you don't call both = and == the same thing. "x gets 5", "set x to 5" or "x is now 5" are all acceptable, but "x equals 5" is not acceptable for teaching purposes.