4 ms·
Personally, I've always read '=' as meaning the left hand side was equal to the right. So if I see x = 5 then I'm already assigning the value of 5 to x, becau
by Rifu 11y ago
Personally, I've always read '=' as meaning the left hand side was equal to the right. So if I see
x = 5
then I'm already assigning the value of 5 to x, because they're equal! Does that make sense? Curious to see what others think, because before reading this article, I didn't even realize that was a particular tripping point for anyone looking to start programming.
- emiliobumachar 11y agoWhat about x=x+1 ? IIRC, the assignment notation mas annoying to me at the very beginning.
- xorcist 11y agoThen you read it as assignment. It's a bit unfortunate that it means something else in mathematics. Pascal used := as the assignment operator, and used = as the equal test. It could also do 1-based indexing of arrays, which is another classic pain point when you start programming with just a tiny bit too much knowledge.
- danso 11y agoAll I know that R's assignment notation, `<-`, bugged the hell out of me after years of equals-sign-assignment...but after playing around with R, I naturally and accidentally use `<-` in Python and other traditional assignment languages.