by thetruthseeker1 · 8y ago · 0 comments
After I understood what it really meant, I wondered why they didn’t use some other symbol to capture this semantic. Say something like x <- x+1 ; Which implies assignment rather than equality - That way this would be unambiguous and I feel is more clear. I now guess the choice of using ‘=‘ was probably an attempt at making a (compromised) choice given the limited symbols that were available back when High level languages were first written?
https://www.hillelwayne.com/post/equals-as-assignment/
The summary is that C used it because assignment was a lot more common than equality checking, and back then, typing fewer characters was a big deal.
https://stackoverflow.com/questions/1741820/what-are-the-dif...
Edit: Misunderstood, thought you were talking about math, not programming languages.
https://en.wikipedia.org/wiki/Assignment_(computer_science)#...