3 ms·
Because it's easy to accidentally type foo = func() when you meant foo == func(). That mistake happens so often in C that modern compilers warn you unless you p
by duckerude 8y ago
Because it's easy to accidentally type foo = func() when you meant foo == func(). That mistake happens so often in C that modern compilers warn you unless you put an extra set of parentheses around it.
It would also cause ambiguity with keyword arguments. You'd have to write foo((x = 3)) because foo(x = 3) already has a meaning. I think foo(x := 3) is clearer.
Maybe it would have been best to use := for all assignment. But it's too late for that.