News for hackers. Stuff that matters.
Re:Khan Academy: Computer Science by jcampbell1 on Tuesday November 01, 2011 @04:11PM (#3183930)
Kahn makes a big mistake in pronouncing the assignment operator as "equals" in the first video. The assignment operator should be pronounced as "gets".
Re:Khan Academy: Computer Science by nosignal on Tuesday November 01, 2011 @07:24PM (#3184622)
I think I'm going to steal this for my Python classes. I usually say "is" or "is now", but "gets" I think is a more adroit phrasing. Cheers.
Re:Khan Academy: Computer Science by radq on Wednesday November 02, 2011 @02:00AM (#3185614)
Personally I prefer "becomes".

"David Gries recalled a time when he was lecturing with Dijkstra in the audience when he read "x=a" as "x equals a". This is of course a short hand for "assign a to x" and not a statement that x really is logically equal to a. From the back of the room Dijkstra shouted "becomes" and the room fell silent. Gries thought about it for a moment and said, "Thank you Edsger, for correcting me. If I make the same mistake again, stop me." Everything went fine until twenty minutes later he made the same mistake when the shout from the back of the room came again - "becomes". Gries once again thanked Dijkstra and claims to never have made the mistake again."

Re:Khan Academy: Computer Science by teach on Wednesday November 02, 2011 @01:38PM (#3187954)
I also say "becomes".
Re:Khan Academy: Computer Science by regularfry on Wednesday November 02, 2011 @07:49AM (#3186234)
gets is, unfortunately, a common function name for string input, so I avoid it.

The first language I was taught was Object Pascal, and the assignment operator ":=" was pronounced "becomes equal to".

Re:Khan Academy: Computer Science by llimllib on Tuesday November 01, 2011 @05:41PM (#3184269)
When I read it in my head, I read it as "let". As in "x = 5" -> "let x be 5".
Re:Khan Academy: Computer Science by pjscott on Tuesday November 01, 2011 @06:24PM (#3184428)
In my head, I reserve the word "let" for immutable bindings. Or at least local bindings that people probably aren't going to mutate. I read it as "x equals five".

So, between three of us, we saw that simple line of code in three different ways. I wonder what other people see in more complicated code.

Re:Khan Academy: Computer Science by jcampbell1 on Wednesday November 02, 2011 @01:29AM (#3185573)
The point is that if you pronounce if(x=5) and if(x==5) both as "if x equals 5", then you are making things confusing for students. You as the teacher are saying the exact same words, but mean two completely different things. Kahn made this mistake and there are student comments showing the confusion.

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.

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.
Re:Khan Academy: Computer Science by llimllib on Wednesday November 02, 2011 @02:37PM (#3188269)
The only thing I liked about PL/SQL back in the day was its use of := for assignment and = for equivalence.
Re:Khan Academy: Computer Science by pjscott on Wednesday November 02, 2011 @03:48PM (#3188630)
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.

Re:Khan Academy: Computer Science by thy on Tuesday November 01, 2011 @11:04PM (#3185196)
'x equals 5'. or something like 'the value inside x is now 5', an important view for me, when was learning c++'s pointers.
Re:Khan Academy: Computer Science by thy on Wednesday November 02, 2011 @07:35AM (#3186207)
(idk how to edit) im just fine with 'x = 5'. lets see 'x = 1+1'. then the 1+1 will be 2, and then that value will be in 'x'. so, after that, 'x equals 2', right? or 'x equals 1+1'.