3 ms·
> It looks more like complete nonsense: `x = x + 1` isn't true for any `x` It does seem you were complaining about the syntax of assignment. In the other comm
by ackfoobar 3y ago
> It looks more like complete nonsense: `x = x + 1` isn't true for any `x`
It does seem you were complaining about the syntax of assignment.
In the other comments it was clearer that your main complaint is that it's hard to compose mutations to reach a desired state. I agree! You should've led with that!
- still_grokking 3y agoIt's not only that, even that's the main point. The syntax is of course also confusing. If you show the above line to a 6. grade child they will tell you that that line makes no sense, obviously. That's why this example is so good! For someone without exposition to (imperative) programming it's completely nuts. But after some "brainwashing" people don't even recognize how weird the example is actually. My hope is always this makes people think (at least after explanation) a little bit whether they maybe just internalized some actually unintuitive stuff and now think that's the "normal" way to look at things, even it's actually not if you come in just with the knowledge from school. Not everybody remember that but most people have for example major issues in grasping a loop with a counting variable in the beginning. It's just not so easy to "do the computation" in your head and track the state of your variable. Variables as such are already confusing to most people. Beginners often use them like constants and declare new ones when they actually need to assign a new value. I've see this pattern quite often! If you ask why it was done this way the answer is often "because re-assignment is confusing"…