Comment by 9rx

Comment by 9rx 2 hours ago

2 replies

> It's an action verb.

The difference is that it is an instruction. Conventional mathematical notation, while declarative by default, switches into instruction mode just the same with the "let" keyword. The usage of the "=" operator then becomes equivalent: e.g. let x = 1.

But as the aforementioned x = x + 1 comes from notations that are never declarative, where every statement is an instruction, the "let" keyword is unnecessary and redundant. You already know you are looking at an instruction.

> Should have perhaps insisted on x <- x + 1 or maybe better x + 1 -> x

While that would obviously work, it strays further from the conventional notation. Which doesn't matter to the universe in any way, but the topic of discussion here is about trying to stay true to conventional notation, so...

jrm4 2 hours ago

Is that the topic?

I do think what I'm trying to say here is: sorry, but your "conventional notation" sucks because "what is actually happening" is so very different from how the thing is overwhelmingly used for most people.

  • 9rx an hour ago

    > Is that the topic?

    Yes. "=" doesn't mean anything in the void of space. Conventional mathematical notation is what established "=" as meaning "equal to", as referenced by the original comment. But the same notation also uses it for assignment when in instruction mode, so imperative languages that use x = x + 1 syntax are quite consistent with it.

    > but your "conventional notation" sucks

    Maybe, but it's all anyone really knows nowadays. It's what you are going to learn in math class in school. It's what you are going to find used in mathematical papers. It is how you are going to express mathematical concepts to your friends and colleagues. Worse is better, I suppose, but it is what has set the standard. It is the de facto language of math. For whatever shortcomings it does have, virtually everyone on earth recognizes it, which is very powerful.

    > so very different from how the thing is overwhelmingly used for most people.

    I'm not sure how to grok this. let x = 1 is something anyone who has taken high school math will have encountered. Assignment is perfectly in line with the understandings of most people.

    Do you mean that expression entirely using imperative constructs is unfamiliar to those who grew up with a primarily declarative view of math? That might be fair, but I'm not sure x = x + 1 is a specific stumbling block in that case. One has to understand imperative logic in its entirety to use these languages anyway, at which point nobody is going to think that x = x + 1 is intended to be declarative equality.