4 ms·
The primary difficulty that I had was the overloaded usage of the "=" character. I had a clear mathematical understanding that the "=" symbol was symmetric, tha
by ISL 6y ago
The primary difficulty that I had was the overloaded usage of the "=" character. I had a clear mathematical understanding that the "=" symbol was symmetric, that 5 = x and x = 5 were equivalent. That someone could abuse that notion so brazenly was the source of my frustration.
Some languages use directional notation for assignment (see [1]):
5 -> x
is clear.
[1] https://en.wikipedia.org/wiki/Assignment_(computer_science)#Notation https://en.wikipedia.org/wiki/Assignment_(computer_science)#...
- teddyh 6y agoPascal and related languages use the notation x := 5 I have heard that this was to mimic (in ASCII) the look of an arrow: x ⇐ 5
- Wowfunhappy 6y agoMy first thought was, if they wanted an arrow why wouldn’t they go with: x <= 5 But of course, that means “less than or equal to”. You could do: x <- 5 But I suppose the mere presence of the “less than” symbol is weird in context. (Although, maybe not inherently weirder than using the equals sign for something other than equality?) Perhaps we would have been better off if we’d all just agreed early on, that @, #, or ~ should represent assignment.
- teddyh 6y agoThe original 1963 version of ASCII had a left-arrow (←) symbol, but it was replaced with underscore (_) in the 1965 version.
- magicalhippo 6y agoOne of the reasons I still quite like Pascal.
- Wowfunhappy 6y agoI know it's more verbose, but I'm deeply fond of Applescript's syntax for assigning variables: set x to 5