upvote
The := vs = debate is a prime example of bikeshedding for programmers. Probably hundreds of thousands of words have been written about it in various online forums. Everyone has an opinion but the truth is that it doesn't matter that much. You learn to use a new Algol-family language, you learn how it does assignment, you move on.
reply
Using '=' for both assignment and comparison is awkward when parsing incomplete code. Consider e.g.:

  j = 5;
The user starts writing (<|> is the cursor position):

  i = <|>
  j = 5;
This is a valid expression (i is a boolean). But the user probably intends to finish writing something like:

  i = 0;
  j = 5;
So in the intermediate state we would like to emit a single warning about an incomplete statement. But since it is valid as written, we instead end up warning about e.g. j being unbound.
reply
> I have always disliked the := as assignment operator convention. In these declarative languages, assignment is done frequently.

> I also don't mind the -> for C pointers

Mmm. These two opinions should be contradictory if held on principle as opposed being held out of impression.

    it = next(it);
    if ((*it)->node->op == EQ) ...
vs.

    it := next(it);
    if it.node.op = EQ ...
Eh. I don't really mind either of those except for the stupid parens after the "if" in the first case.

Technically, if you don't make assignment an expression, you can even get away with using "=" for both. And "->" exists only because structs originally weren't really typechecked; you could take any pointer and just do "->struct_field" at it, and the compiler would auto-cast.

reply