3 ms·
I'm not a Rust programmer, but I can read and mostly understand the Rust code I've seen. This by comparison is incomprehensible to me. Your analogy to maths d
by mkl 5y ago
I'm not a Rust programmer, but I can read and mostly understand the Rust code I've seen. This by comparison is incomprehensible to me. Your analogy to maths doesn't seem to hold up, because I am a mathematician, and still find this syntax unreadable. To me it is almost the definition of "visual noise", as it doesn't use words where maths would, and contains many extra redundant-seeming symbols maths would omit. I also really like Python's indentation syntax, so I have no objection to that in principle.
Take these three lines from the README example:
|?| ^door <= 100
^door_open[door - 1] !^door_open[door - 1]
^door += pass;
Without the docs I don't have any idea what this does. Even with the docs it makes very little sense to me. |?| seems to start a loop, but it doesn't seem to be in the documentation (the closest thing is |??| for "while"). ^ means mutability, but is needed in the first line for some reason even though no mutation is happening? (Or is mutation happening? <= doesn't seem to have changed meaning though.) But then ^ is not needed on the mutable "door" in the second line? What does the second line do? It's not assignment, according to the docs, because that is a very un-mathematical prefix thing (but everything else, including other assignments like +=, is infix?). It seems to be just two expressions next to each other, and the docs don't seem to say that's meaningful. Why does the third line have a ;, but not the second? Is the second line somehow part of a statement finished on the third (which isn't indented)? Is the second line a ?-less condition affecting the third?
I am not being sarcastic or trolling. I genuinely don't understand this. The assumptions I'm aware of making are (1) the documentation covers everything new in the new syntax, and (2) the example in the README is valid code in the new syntax.
Serious question: do you understand these "much more readable" three lines?