4 ms·
As usual, much of what Niklaus Wirth writes is over my head. But I agree with him that using the equal sign for assignment is an unfortunate choice. I remember
by andrewl 8y ago
As usual, much of what Niklaus Wirth writes is over my head. But I agree with him that using the equal sign for assignment is an unfortunate choice. I remember being confused by it in my first programming class ages ago. I thought foo = 10 was a test and not an assignment, and, when the assignment was the first occurrence of foo, I remember being confused about how you could test whether it equaled 10 if it had yet to be defined. I got over the problem soon enough, but I'm sure I wasn't the first person to have it.
Wirth points out that Algol used := for assignment. That is also what Smalltalk uses, which leaves = for testing equality (and == for testing object identity). Of course, after using the equals sign for assignment for so long, I often stumbled when I was in Pharo.