Member-only story
Why Most Programming Languages Use the Worst Possible Assignment Syntax
And What We Can Learn From Python’s Mistake
My first programming language was Pascal. I haven’t used it for a long time and I’ve forgotten many things about it, but I still vividly remember Turbo Pascal’s blue text-based interface.
Another thing I’ve never forgotten about the language is its assignment operator. I’m talking about the colon-equals operator (:=), which is used to assign a value to a variable.
I could criticize some aspects of the language, but I think this is one thing it got right.
var
a, b : integer;
begin
b := 1;
a := b;
end; Later on, this syntax fell out of favor, and many programming languages adopted the equals sign (=) for the same purpose, including C and its derivatives.
int main() {
int a, b;
b = 1;
a = b;
}The use of the equals sign (=) for assignment dates back to a language called as Superplan (1949–1951) and was later popularized by Fortran (1957).
Niklaus Wirth, the designer of the Pascal programming language, criticized this choice, but it didn’t prevent other languages from copying the same syntax.
A notorious example for a bad idea was the…






